SDK
SDK PHP v3.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.

getPolicies #

Returns roles associated to this security policy.


Return Value #

Returns an array of roles linked to this security policy.

Usage #

<?php
use Kuzzle\Security\Profile;
use Kuzzle\Security\Policy;
// ...
/*
  * @var $profile Profile
  */
foreach($profile->getPolicies() as $policy) {
  // $policy instanceof Policy
}

Callback response

[
  {
    "roleId": "<role name1>",
    "restrictedTo": {
      "index": "<some index>",
      "collections": ["<collection1>", "<collection2>", "<...>"]
    }
  },
  {
    "roleId": "<role name2>"
  },
  {
    "roleId": "<role name3>",
    "restrictedTo": {
      "index": "<some other index>",
      "collections": ["<collection>"]
    }
  }
]