SDK
SDK Javascript v5.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.

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) #

ArgumentsTypeDescription
profileIdsarray of stringsList of profile IDs

setProfiles(profiles) #

ArgumentsTypeDescription
profilesarray of Profile objectsAn array of instantiated Profile objects

Return Value #

Returns the User object.

Usage #

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']);