new ChinoAPIPerms(baseUrl, customerId, customerKey)
Create a caller for Permissions Chino APIs
Parameters:
Name | Type | Default | Description |
---|---|---|---|
baseUrl |
string | The url endpoint for APIs |
|
customerId |
string | The Chino customer id or bearer token |
|
customerKey |
string | null | null | The Chino customer key or null (not provided) |
Methods
getDocumentPermissions(documentId) → {Promise.<Array, objects.ChinoException>}
Return permissions on selected document
Parameters:
Name | Type | Description |
---|---|---|
documentId |
string |
Returns:
A promise that return a list of Perms object if resolved, otherwise throw a ChinoException if rejected or was not retrieved a success status
- Type
- Promise.<Array, objects.ChinoException>
getGroupPermissions(groupId) → {Promise.<Array, objects.ChinoException>}
Return permissions on selected group
Parameters:
Name | Type | Description |
---|---|---|
groupId |
string |
Returns:
A promise that return a list of Perms object if resolved, otherwise throw a ChinoException if rejected or was not retrieved a success status
- Type
- Promise.<Array, objects.ChinoException>
getPermissions() → {Promise.<Array, objects.ChinoException>}
Return permissions on all the resources
Returns:
A promise that return a list of Perms object if resolved, otherwise throw a ChinoException object if rejected or was not retrieved a success status
- Type
- Promise.<Array, objects.ChinoException>
getUserPermissions(userId) → {Promise.<Array, objects.ChinoException>}
Return permissions on selected user
Parameters:
Name | Type | Description |
---|---|---|
userId |
string |
Returns:
A promise that return a list of Perms object if resolved, otherwise throw a ChinoException if rejected or was not retrieved a success status
- Type
- Promise.<Array, objects.ChinoException>
onChildren(data) → {Promise.<objects.Success, objects.ChinoException>}
Grant or revoke permission on resource children objects
Parameters:
Name | Type | Description |
---|---|---|
data |
object | A JS object that contains parameters for working on permissions. Parameters are:
|
Returns:
A promise that return a Success object if resolved, otherwise throw a ChinoException if rejected or was not retrieved a success status
- Type
- Promise.<objects.Success, objects.ChinoException>
onResource(data) → {Promise.<objects.Success, objects.ChinoException>}
Grant or revoke permission on resource objects
Parameters:
Name | Type | Description |
---|---|---|
data |
object | A JS object that contains parameters for working on permissions. Parameters are:
|
Returns:
A promise that return a Success object if resolved, otherwise throw a ChinoException if rejected or was not retrieved a success status
- Type
- Promise.<objects.Success, objects.ChinoException>
onResources(data) → {Promise.<objects.Success, objects.ChinoException>}
Grant or revoke permission on resources objects
Parameters:
Name | Type | Description |
---|---|---|
data |
object | A JS object that contains parameters for working on permissions. Parameters are:
|
Returns:
A promise that return a Success object if resolved, otherwise throw a ChinoException if rejected or was not retrieved a success status
- Type
- Promise.<objects.Success, objects.ChinoException>