updateProfile #
Updates a security profile definition.
Future<KuzzleProfile> updateProfile(String id, List<dynamic> policies,
{bool waitForRefresh})
Property | Type | Description |
---|---|---|
id | String | Profile identifier |
policies | List<dynamic> | 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 #
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' ] } ] } ]
*/
Edit this page on Github(opens new window)