Core 2.x

getProfile

Gets a security profile.


Copied to clipboard!
getProfile(id, [options]);

Property Type Description
id
string
Profile identifier
options
object
Query options

options

Additional query options

Property Type
(default)
Description
queuable
boolean

(true)
If true, queues the request during downtime, until connected to Kuzzle again

Resolves

The retrieved Profile object.

Usage

Copied to clipboard!
try {
  const response = await kuzzle.security.getProfile('myProfile');
  console.log(response);
  /*
  Profile {
    _id: 'myProfile',
    policies:
      [ { roleId: 'admin',
        restrictedTo:
          [ { index: 'someIndex' },
            { index: 'anotherIndex', collections: [ 'someCollection' ] } ] },
        { roleId: 'default' } ] }
   */
} catch (e) {
  console.error(e);
}