Permissions
Create or Update Permissions
Endpoints
PUT /objectmodelsvc/api/v1/permissions
Request
Body parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
_resourceDesc._irn | String | Enter the resource's path. For the resource path, concetenate the service name, resource type, and resource's id with colons, for example, filesvc:file:6336c490017d84b0a506e453 for a file, or filesvc:file:* for all files in the file service. | Required |
_namespace | String | Pass a namespaces for the permission's context. | Required |
_user._type | String | The type of the permission user, such as "user", "usergroup" or "permprofile". | Required |
_user._id | String | The permission user's id. | Required |
_actions | String | The actions the user is authorized to perform on the resource, such as "READ", "CREATE", "DELETE", "SHARE" or "*" for all actions. | Required |
Body example
[
{
"_actions": [
"*"
],
"_namespace": "NextScriptProj1_FL2gjKxa",
"_resourceDesc": {
"_irn": "objectmodelsvc:apiconfigdef:*"
},
"_user": {
"_type": "user",
"_id": "2cefaaec-b57c-4e21-826d-773480a1948e"
}
}
]
Response
Response codes
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
Response data example
{
"_offset": 0,
"_list": {
"_success": [
{
"_namespace": "NextScriptProj1_FL2gjKxa",
"_user": {
"_id": "2cefaaec-b57c-4e21-826d-773480a1948e",
"_type": "user"
},
"_actions": [
"*"
],
"_status": 200,
"_id": "242a2fab-6ec6-4c2b-8aba-f32aede4cf6a",
"_resourceDesc": {
"_irn": "objectmodelsvc:apiconfigdef:*"
}
}
],
"_failures": []
}
}
Get Permissions
Endpoints
GET /objectmodelsvc/api/v1/permissions
Request
Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
_namespace | String | The namespace in which the permission is defined. | Required |
_resourceDesc._irn | String | The resource's path. For the resource path, concetenate the service name, resource type, and resource's id with colons, for example, filesvc:file:6336c490017d84b0a506e453 for a file, or filesvc:file:* for all files in the file service. | Required |
_user._id | String | The permission user's id. | Required |
_user._type | String | The type of the permission user, such as "user", "usergroup" or "permprofile". | Required |
patternmatch | String | Set to true to treat the irn as a pattern to match, otherwise, set to false. | Required |
Response
Response codes
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
Response data example
{
"_offset": 0,
"_pageSize": 2,
"_total": 2,
"_list": [
{
"_namespace": "NextScriptProj1_FL2gjKxa",
"_user": {
"_id": "32995061-a7f9-47ad-b8b9-e2c4b81ee919",
"_type": "user"
},
"_actions": [
"*"
],
"_id": "0edf3adc-344a-4a59-82ec-408437a99672",
"_resourceDesc": {
"_irn": "*:*:*"
}
},
{
"_namespace": "NextScriptProj1_FL2gjKxa",
"_user": {
"_id": "cd87d40e-9621-408a-a2ac-f1b993c554b2",
"_type": "usergroup"
},
"_actions": [
"*"
],
"_id": "d939ea3c-231a-46a5-88f6-7f384cc30ef0",
"_resourceDesc": {
"_irn": "*:*:*"
}
}
]
}
Delete Permission by Id
Endpoints
DELETE /objectmodelsvc/api/v1/permissions/{id}
Request
Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
id | String | Pass the permission's id. | Required |
Response
Response codes
| Code | Description |
|---|---|
204 | No Content |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
Response
None