SDK
SDK Dart v1.x
2

# updateProfile

Updates a security profile definition.


Copied to clipboard!
 Future<KuzzleProfile> updateProfile(String id, List<dynamic> policies,
      {bool waitForRefresh})

Property Type Description
id
String
Profile identifier
policies
List
Profile definition content
waitForRefresh
bool

(null)
If set to true, Kuzzle will not respond until the created profile is indexed

# Return

A Profile object representing the updated profile.

# Usage

Copied to clipboard!
final result = await kuzzle.security.updateProfile(
  'myProfile',
  [
    {
      'roleId': 'default'
    },
    {
      'roleId': 'privileged',
      'restrictedTo': [
        {
          'index': 'someindex'
        },
        {
          'index': 'anotherindex',
          'collections': [
            'coll1',
            'coll2'
          ]
        }
      ]
    }
  ]
);
/*
Profile {
  _id: 'myProfile',
  policies:
    [ { roleId: 'default' },
      { roleId: 'privileged',
        restrictedRo:
          [ { index: 'someIndex' },
            { index: 'anotherIndex', collections: [ 'coll1', 'coll2' ]  } ] } ]
*/