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

Arguments Type Description
profileId string Profile ID

addProfile(profile) #

Arguments Type Description
profile Profile An instantiated Profile object

Return Value #

Returns the User object.

Usage #

Copied to clipboard!
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');