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.

setContent #

Replaces the content of the Profile object.

Updating a profile will have no impact until the save method is called

setContent(data) #

Arguments Type Description
data JSON Object Profile content

Return Value #

Returns the Profile object.

Usage #

Copied to clipboard!
var profile = kuzzle.security.fetchProfile('myprofile');
var profileDefinition = {
  policies: [
    {roleId: 'myrole'},
    {roleId: 'default', restrictedTo: [{index: 'index1'}, {index: 'index2', collections: ['foo', 'bar'] } ] }
  ]
};
profile = profile.setContent(profileDefinition);