SDK
SDK Dart v2.x
2

updateProfile #

Updates a security profile definition.


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

PropertyTypeDescription
idStringProfile identifier
policiesList<dynamic>Profile definition content
waitForRefreshbool
(null)
If set to true, Kuzzle will not respond until the created profile is indexed

Return #

A Profile object representing the updated profile.

Usage #

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' ]  } ] } ]
*/