Commands: How to retrieve user permission for a specified database?
GetUserPermission
used to retrieve user permissions for a specified database
Syntax
UserPermission GetUserPermission(string database, bool readOnly);
Parameters | ||
---|---|---|
database | string | name of the database we want to retrive the permissions |
readOnly | bool | the type of the operations allowed, read only , or read-write |
Return Value | |
---|---|
UserPermission | Retrieves user permissions for a specified database. |
Example I
var per = store.DatabaseCommands.GetUserPermission("Foo", false);
var isGrant = per.IsGranted;
var res = per.Reason;