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.

addProfile #

Replaces the security profile associated with the user.

Updating a user will have no impact until the [`create`](/sdk/js/5/core-classes/user/create) or [`replace`](/sdk/js/5/core-classes/user/replace) method is called

addProfile(profileId) #

ArgumentsTypeDescription
profileIdstringProfile ID

addProfile(profile) #

ArgumentsTypeDescription
profileProfileAn instantiated Profile object

Return Value #

Returns the User object.

Usage #

var profile = kuzzle.security.fetchProfile('myprofile', function(error, profile) {
  // Can add a profile directly with a Profile object
  user.addProfile(profile);
});
// Or by passing an id
user.addProfile('myprofile');