isActionAllowed, rights) => {
    if (!err) {
        // returns either "allowed", "denied" or "conditional"
        var allowed =, 'read', 'get', 'index1', 'collection1');
}); ResponseListener<JSONObject[]>() {
    public void onSuccess(JSONObject[] rights) {
        // Policies is an enum with the following properties:
        // allowed, denied, conditional
        Policies authorization =, "read", "get", "index1", "collection1");

    public void onError(JSONObject error) {
     // ...

use \Kuzzle\Kuzzle;
use \Kuzzle\Security\Security;

$kuzzle = new Kuzzle('localhost');

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

  switch ($kuzzle->security()->isActionAllowed($rights, 'read', 'get', 'index1', 'collection1')) {
    case Security::ACTION_ALLOWED:
      // code...
    case Security::ACTION_DENIED:
      // code...
    case Security::ACTION_CONDITIONAL:
      // code...
catch (ErrorException $e) {


Tells whether an action is allowed, denied or conditional based on the rights provided as the first argument:

  • allowed is returned when an action is authorized without condition
  • conditional is returned when the authorization depends on a closure
  • denied is returned when the action is forbidden

An action is defined as a couple of action and controller (mandatory), plus an index and a collection(optional).

isActionAllowed(rights, controller, action, index, collection)

rightsJSON arrayRights list
controllerStringThe controller
actionStringThe action
indexStringThe index
collectionStringThe collection

Return value

Returns either allowed, denied or conditional.