getUserRights

// Using callbacks (NodeJS or Web Browser)
kuzzle
  .security
  .getUserRights('kuid', function(error, rights) {

  });

// Using promises (NodeJS)
kuzzle
  .security
  .getUserRightsPromise('kuid')
  .then(rights => {

  });
kuzzle
  .security
  .getUserRights("kuid", new ResponseListener<JSONObject[]>() {
    @Override
    public void onSuccess(JSONObject[] rights) {

    }

    @Override
    public void onError(JSONObject error) {

    }
  });
<?php

use \Kuzzle\Kuzzle;

$kuid = 'myUser';

$kuzzle = new Kuzzle('localhost');

try {
  $rights = $kuzzle->security()->getUserRights($kuid);

}
catch (ErrorException $e) {

}

Callback response example

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

Gets the rights of the currently logged user.


getUserRights(id, [options], callback)

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

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Callback response

Resolves to an array of JSON objects.