Test It Out
Using the Query Console, you can execute Scenario 1, Scenario 2, and Scenario 3 for each one of the users user1
, user2
, and user3
. The results of the execution are presented in the following table:
User |
Role |
Scenario |
Result |
---|---|---|---|
|
|
Add range index to database db1 |
Success |
|
|
Add range index to database db2 |
Success |
|
|
Add backup for database db1 |
Failure |
|
|
Add range index to database db1 |
Success |
|
|
Add range index to database db2 |
Failure |
|
|
Add backup for database db1 |
Success |
|
|
Add range index to database db1 |
Success |
|
|
Add range index to database db2 |
Failure |
|
|
Add backup for database db1 |
Failure |
The following analysis explains these results:
The user
user1
successfully adds indexes to both databasesdb1
anddb2
, but fails to add backup to databasedb1
, because the user’srole1
has granular privilegehttp://marklogic.com/xdmp/privileges/admin/database/index
that allows to add indexes to any database but does not allow other operations on databases.The user
user2
successfully adds both the index and backup to databasedb1
, but fails to add index to databasedb2
, because the user’srole2
has granular privilegehttp://marklogic.com/xdmp/privileges/admin/database/
db1_identifier that allows this user to perform any operation on databasedb1
but does not allow operations on other databases.The user
user3
successfully adds index to databasedb1
but fails to add index to databasedb2
and to add backup to databasedb1
, because the user’srole3
has granular privilegehttp://marklogic.com/xdmp/privileges/admin/database/index/
db1_identifier that allows to add indexes to databasedb1
but does not allow any other operation on databasedb1
and does not allow any operation on other databases.