Access Rights
The feature flag integrationservices.authorization.accessrights.enabled, which is enabled by default, provides a powerful authorization feature for administrators.
Enhanced authorization allows you to restrict access to each Type defined in the IntegrationObjectItemType of the Integration Object. Access Rights control the level of access to the following API verbs:
-
Create – POST
-
Read – GET
-
Update – POST, PATCH
-
Remove – DELETE
This allows integration administrators to finely tune the level of access to Integration Objects by only allowing interaction with certain IntegrationObjectItemTypes. For example, Access Rights could be configured so that a user has access to create Products (POST), but only has Read Access (GET) to Categories.
Access Rights are assigned at the type level, not at the Integration Object level. That means that when a user is granted privileges to interact with, for example, the Product type, any Integration Object that contains that type in its definition observes the type-level Access Rights restrictions. For more information on Access Rights and how they work in general, see Access Rights.
Access Rights for Administration Meta API Types: The administration Meta API types are the Integration Object Item types associated with the Integration Objects IntegrationService, ScriptService, and OutboundChannelConfig. By default, these types are given Read, Create, Update, and Remove access rights for the user group integrationadmingroup.
Access Rights for Monitoring Meta API Types: The monitoring Meta API types are the Integration Object Item types associated with the Integration Objects InboundIntegrationMonitoring and OutboundIntegrationMonitoring. By default, the types used for monitoring are only given Read access for the user group integrationmonitoringgroup.
Setting Up Access Rights via API
You can enable the permissionswebservices extension to set up access rights (permissions) for users by adding permissions for system types. For more information, see permissionswebservices Extension.
Setting Up Access Rights via ImpEX
To set up access rights using the Backoffice Integration UI Tool, see Setting Up Access Rights for Integration Objects.
For some specific examples of how type Access Rights affect Integration APIs, see the following examples.
Example Scenarios
Expanding a Type Without Read Permissions
Access Rights Configuration
| Type | Create | Read | Update | Delete |
|---|---|---|---|---|
| Order | Yes | Yes | Yes | Yes |
| OrderEntry | Yes | No | Yes | Yes |
Request URL
GET https://localhost:9002/odata2webservices/InboundOrder/Orders?$expand=entries
Response
403 Forbidden - The user lacks read privileges for accessing the OrderEntry type.
Access to a Navigation Property Without Read Permissions
Access Rights Configuration
| Type | Create | Read | Update | Delete |
|---|---|---|---|---|
| Order | Yes | Yes | Yes | Yes |
| OrderEntry | Yes | No | Yes | Yes |
Request URL
GET https://localhost:9002/odata2webservices/InboundOrder/Orders('ord1')/entries
Response
403 Forbidden - The user lacks read privileges for accessing the OrderEntry type.
Updating by POST Request on a Type with No Update Permissions
In the following scenario, an order item with the code ord1 exists, and the POST request includes an updated value for date.
Access Rights Configuration
| Type | Create | Read | Update | Delete |
|---|---|---|---|---|
| Order | Yes | Yes | No | Yes |
Request URL
POST https://localhost:9002/odata2webservices/InboundOrder/Orders
Request Body
{
"code": "ord1",
"date": "/Date(1540469763078)/"
}
Response
403 Forbidden - The user lacks change privileges for accessing the Order type.Updating a Subtype with No Permissions with a POST Request to the Root Type with Permissions
In this scenario, the order and orderEntry exist. The order item has the code ord1 and the entry has the entryNumber 1. The request is to update an order with a nested entry that includes an updated value for quantity.
Access Rights Configuration
| Type | Create | Read | Update | Delete |
|---|---|---|---|---|
| Order | Yes | Yes | Yes | Yes |
| OrderEntry | Yes | Yes | No | Yes |
Request URL
POST https://localhost:9002/odata2webservices/InboundOrder/Orders
Request Body
{
"code": "ord1",
"entries": [
{
"entryNumber": 1,
"quantity": "7"
}
]
}
Response
403 Forbidden - The user lacks change privileges for accessing the OrderEntry type.Updating a Nested Type with No Update Permissions with a POST Request
This example assumes an order item, ord1, with an entryNumber of 1 exists. The POST request updates an existing order entry with a different value for quantity.
Access Rights Configuration
| Type | Create | Read | Update | Delete |
|---|---|---|---|---|
| Order | Yes | Yes | Yes | Yes |
| OrderEntry | Yes | Yes | No | Yes |
Request URL
POST https://localhost:9002/odata2webservices/InboundOrder/OrderEntries
Request Body
{
"order": {
"code": "ord1",
},
"entryNumber": 1,
"quantity": "2"
}
Response
403 Forbidden - The user lacks change privileges for accessing the OrderEntry type.