You are currently browsing legacy 3.5 version of documentation. Click here to switch to the newest 5.1 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

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;