setProfiles #
Replaces the security profiles linked to the user.
setProfiles(profileIds) #
Arguments | Type | Description |
---|---|---|
profileIds | array of strings | List of profile IDs |
setProfiles(profiles) #
Arguments | Type | Description |
---|---|---|
profiles | array of Profile objects | An array of instantiated Profile objects |
Return Value #
Returns the User
object.
Usage #
<?php
use Kuzzle\Security\Profile;
use Kuzzle\Security\User;
// ...
$profile = $kuzzle->security->fetchProfile('myProfile');
/*
* @var $user User
*/
// Updating the profile with a Profile object
$user->setProfiles([$profile]);
// Updating the profile with a profile ID
$user->setProfiles(['myProfile']);
Edit this page on Github(opens new window)