SDK
SDK Javascript v5.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

getUserRights #

Callback response example

[
  {
    "controller": "my-controller",
    "action": "my-action",
    "index": "*",
    "collection": "*",
    "value": "allowed"
  },
  {
    "controller": "another-controller",
    "action": "*",
    "index": "my-index",
    "collection": "*",
    "value": "conditional"
  }
]

Given a Kuzzle user id (kuid), retrieves the list of permissions granted to that user.


getUserRights(id, [options], callback) #

ArgumentsTypeDescription
kuidStringKuzzle User Unique Identifier
optionsJSON ObjectOptional parameters
callbackfunctionCallback handling the response

Options #

OptionTypeDescriptionDefault
queuablebooleanMake this request queuable or nottrue

Callback Response #

Returns an array of objects.

Usage #

// Using callbacks (NodeJS or Web Browser)
kuzzle
  .security
  .getUserRights('kuid', function(error, rights) {
  });reflecting
// Using promises (NodeJS)
kuzzle
  .security
  .getUserRightsPromise('kuid')
  .then(rights => {
  });