loadSecurities #
Load roles, profiles and users into the storage layer.
The roles, profiles and users definitions follow the same structure as in the body parameter of their corresponding API actions:
By default, Kuzzle prevents existing user overwriting.
You can either skip or overwrite existing users with the onExistingUsers
option.
Notes:
- The body can contain any number of roles, profiles and users.
- If a role, profile or user already exists, it will be replaced.
- Fixtures are loaded sequentially: first the roles, then the profiles and finally the users. If a failure occurs, Kuzzle immediately interrupts the sequence, without rollbacking what has already been loaded.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/admin/_loadSecurities[?refresh=wait_for][&onExistingUsers=skip|overwrite|fail][&force]
Method: POST
Body:
{
"roles": {
"role-id": {
/* role definition */
}
},
"profiles": {
"profile-id": {
/* profile definition */
}
},
"users": {
"user-id": {
/* user definition */
}
}
}
Other protocols #
{
"controller": "admin",
"action": "loadSecurities",
"body": {
"roles": {
"role-id": {
/* role definition */
}
},
"profiles": {
"profile-id": {
/* profile definition */
}
},
"users": {
"user-id": {
/* user definition */
}
}
}
}
Arguments #
Optional: #
onExistingUsers
: can be set to eitherfail
(default),skip
oroverwrite
to either fail, skip or overwrite existing usersrefresh
: if set towait_for
, Kuzzle will not respond until the fixtures are loadedforce
: if set totrue
, creates the role even if it gives access to non-existent plugins API actions.
Response #
Returns a confirmation that the command is being executed.
{
"requestId": "d16d5e8c-464a-4589-938f-fd84f46080b9",
"status": 200,
"error": null,
"controller": "admin",
"action": "loadSecurities",
"collection": null,
"index": null,
"result": { "acknowledge": true }
}
Edit this page on Github (opens new window)