DocumentClient.CreatePermissionAsync
Method
Definition
Overloads
| CreatePermissionAsync(String, Permission, RequestOptions) |
Creates a permission on a user object as an asychronous operation in the Azure DocumentDB database service. |
| CreatePermissionAsync(Uri, Permission, RequestOptions) |
Creates a permission as an asychronous operation in the Azure DocumentDB database service. |
CreatePermissionAsync(String, Permission, RequestOptions)
Creates a permission on a user object as an asychronous operation in the Azure DocumentDB database service.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Permission>> CreatePermissionAsync (string userLink, Microsoft.Azure.Documents.Permission permission, Microsoft.Azure.Documents.Client.RequestOptions options = null);
- userLink
- String
The link of the user to create the permission for. E.g. dbs/db_rid/users/user_rid/
- permission
- Permission
The Permission object.
- options
- RequestOptions
(Optional) The request options for the request.
A task object representing the service response for the asynchronous operation which contains the created Permission object.
If either userLink or permission is not set.
Represents a consolidation of failures that occured during async processing. Look within InnerExceptions to find the actual exception(s)
This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when creating a Document are:
| StatusCode | Reason for exception |
|---|---|
| 400 | BadRequest - This means something was wrong with the request supplied. |
| 403 | Forbidden - You have reached your quota of permission objects. Contact support to have this quota increased. |
| 409 | Conflict - This means a Permission with an id matching the id you supplied already existed. |
CreatePermissionAsync(Uri, Permission, RequestOptions)
Creates a permission as an asychronous operation in the Azure DocumentDB database service.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Permission>> CreatePermissionAsync (Uri userUri, Microsoft.Azure.Documents.Permission permission, Microsoft.Azure.Documents.Client.RequestOptions options = null);
- userUri
- Uri
the URI of the user to create the permission for.
- permission
- Permission
the Microsoft.Azure.Documents.Permission object.
- options
- RequestOptions
The request options for the request.
The task object representing the service response for the asynchronous operation.