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 #
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);
Edit this page on Github(opens new window)