ChinoAPIPerms

ChinoAPIPerms

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)

Source:

Methods

getDocumentPermissions(documentId) → {Promise.<Array, objects.ChinoException>}

Return permissions on selected document

Parameters:
Name Type Description
documentId string
Source:
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
Source:
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

Source:
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
Source:
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:

- action        {string} The permission action to execute                      {grant | revoke}
- resourceType  {string} The resource on which execute the action
- resourceId    {string} The id of the resource on which target can manage
- childrenType  {string} The resource children of resource type on target can manage
- subjectType   {string} The target type of permission action                  {users | user_schemas | groups}
- subjectId     {string} The id of the target type
- permissions   {object} Which permissions have to granted or revoked
Source:
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:

- action        {string} The permission action to execute         {grant | revoke}
- resourceType  {string} The resource on which execute the action
- resourceId    {string} The id of the resource on which target can manage
- subjectType   {string} The target type of permission action     {users | user_schemas | groups}
- subjectId     {string} The id of the target type
- permissions   {object} Which permissions have to granted or revoked
Source:
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:

- action        {string} The permission action to execute                    {grant | revoke}
- resourcesType {string} The top level resource on which execute the action  {repositories | user_schemas | groups}
- subjectType   {string} The target type of permission action                {users | user_schemas | groups}
- subjectId     {string} The id of the target type
- permissions   {object} Which permissions have to granted or revoked
Source:
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>