profile

Instantiate a new security Profile object.


profile(id, content)

Arguments Type Description
id string Unique profile identifier
content JSON Object Profile content

Return Value

Returns the new security Profile object.

Usage

Copied to clipboard!
var profileDefinition = {
  policies: [
    {roleId: 'myrole'},
    {roleId: 'default', restrictedTo: [{index: 'index1'}, {index: 'index2', collections: ['foo', 'bar'] } ] }
  ]
};

var profile = kuzzle.security.profile('myprofile', profileDefinition);