setProfiles

Replaces the security profiles linked to the user.

Updating a user will have no impact until the create or replace method is called

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

Copied to clipboard!
var profile = kuzzle.security.fetchProfile('myprofile', function(error, profile) {
  // Can set the profiles directly with a Profile object
  user.setProfiles([profile]);
});

// Or by passing their ids
user.setProfiles(['myprofile']);