profile #
Instantiate a new security Profile object.
profile(id, content) #
Arguments | Type | Description |
---|---|---|
id | string | Unique profile identifier |
content | JSON Object | Profile content |
Return Value #
Returns the new security Profile object.
Usage #
<?php
use \Kuzzle\Kuzzle;
use \Kuzzle\Security\Profile;
$profileId = 'myProfile';
$profileDefinition = [
'policies' => [
[
'roleId' => 'myRole'
],
[
'roleId' => 'anonymous',
'restrictedTo' => [
['index' => 'my-second-index', 'collection' => ['my-collection']]
]
]
]
];
$kuzzle = new Kuzzle('localhost');
$security = $kuzzle->security();
$profile = $security->profile($profileId, $profileDefinition);
// $profile instanceof Profile
Edit this page on Github(opens new window)