Skip to main content
Version: v5.2

File Permissions

Use the File Permission API so that users can complete the following actions:

  • Get, create, update, or delete resource permissions.

Users can perform these actions on other users' resources if they have SHARE permissions for that resource.

Note: When a user creates a resource, such as a file, they automatically receive all permissions for the resource.

Get Permissions

Gets a file's permissions for a user or usergroup.

Endpoints

GET /filesvc/api/v1/permissions

Request

Parameters

Query
ParameterTypeDescriptionRequired
_namespaceStringThe namespace that contains the permission.Required
_resourceDescObjectPass an object with an _irn property.Required
_resourceDesc._irnStringIn the _resourceDesc object, add an _irn property with the resource's path as its value. 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
_userObjectPass an object with _id and _type properties.Required
_user._idStringPass the id of the user with permissions for the resource. If you do not pass an id, the logged in user's id is used.Optional
_user._typeStringIf the permission is for a user, pass "user"; for a user group, pass "usergroup"; for permission profile pass "permprofile".Required if you pass a _user object

Response

Codes

CodeDescription
200Success
400Bad Request

Body

Code example
{
"_pageSize": 1,
"_list": [
{
"_actions": [
"READ"
],
"_namespace": "wsDUser3_DYwgNJyT",
"_irn": "filesvc:file:5ac6f43da7b11b0001ef4177",
"_user": {
"_type": "user",
"_id": "ab38424d-69b2-4353-812e-78faac6ebd7a"
},
"_id": "0d0c1064-5718-4cee-9779-b86db5f9ba0c"
}
],
"_offset": 0,
"_total": 1,
"_includeTotal": true
}

Create or Update Permissions

Creates a file permission for a user or usergroup. If the file permission already exists, it updates with your new values.

Endpoints

POST /filesvc/api/v1/permissions

Parameters

Body

ParameterTypeDescriptionRequired
_resourceDescObjectresource descriptor for which the permission creates.Required
_resourceDesc._irnStringIn the _resourceDesc object, add an _irn property with the resource's path as its value. 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
_resourceDesc._criteriaStringPass a key-value pair.Optional
_namespaceStringThe namespace that contains the permission.Required
_userObjectPass an object with _id and _type properties.Required
_user._idStringPass the id of the user with permissions for the resource. If you do not pass an id, the logged in user's id is used.Optional
_user._typeStringIf the permission is for a user, pass "user"; for a user group, pass "usergroup"; for permission profile pass "permprofile"Required if you pass a _user object
_actionsArray of StringAn array that contains the permissions you want to give the user for the resource, such as "READ", "CREATE", "EDIT", "DELETE", or "SHARE". To grant all permissions, pass "*".Required
Code example
[
{
"_actions": [
"READ"
],
"_namespace": "r_TmBKvZTI",
"_resourceDesc": {
"_irn": "filesvc:file:5ac6f43da7b11b0001ef4177",
"_criteria": {
"_userType": "iput_cde_admin"
}
},
"_user": {
"_type": "user",
"_id": "1f159053-657b-40f4-9897-434f9e2df8be"
}
}
]

Response

Codes

CodeDescription
200Success
400Bad Request

Body

Code example
{
"_success": [
{
"_actions": [
"READ"
],
"_namespace": "wsDUser3_DYwgNJyT",
"_resourceDesc": {
"_irn": "filesvc:file:5ac6f43da7b11b0001ef4177"
},
"_user": {
"_type": "user",
"_id": "ab38424d-69b2-4353-812e-78faac6ebd7a"
},
"_id": "0d0c1064-5718-4cee-9779-b86db5f9ba0c",
"_status": 200
}
],
"_failures": []
}

Delete Permission by Id

Deletes a permission when you pass its id.

Endpoints

DELETE /filesvc/api/v1/permissions/{id}

Request

Parameters

Path
ParameterTypeDescriptionRequired
idStringPass the permission's id.Required

Response

Codes

CodeDescription
204No Content
404Not found