DocumentClient.DeletePermissionAsync Method

Definition

Overloads

DeletePermissionAsync(Uri, RequestOptions)

Delete a permission as an asynchronous operation from the Azure Cosmos DB service.

DeletePermissionAsync(String, RequestOptions)

Delete a Permission from the Azure Cosmos DB service as an asynchronous operation.

DeletePermissionAsync(Uri, RequestOptions)

Delete a permission as an asynchronous operation from the Azure Cosmos DB service.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Permission>> DeletePermissionAsync (Uri permissionUri, Microsoft.Azure.Documents.Client.RequestOptions options = default);
abstract member DeletePermissionAsync : Uri * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Permission>>
override this.DeletePermissionAsync : Uri * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Permission>>
Public Function DeletePermissionAsync (permissionUri As Uri, Optional options As RequestOptions = Nothing) As Task(Of ResourceResponse(Of Permission))

Parameters

permissionUri
Uri

the URI of the permission to delete.

options
RequestOptions

The request options for the request.

Returns

The task object representing the service response for the asynchronous operation.

Implements

Applies to

DeletePermissionAsync(String, RequestOptions)

Delete a Permission from the Azure Cosmos DB service as an asynchronous operation.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Permission>> DeletePermissionAsync (string permissionLink, Microsoft.Azure.Documents.Client.RequestOptions options = default);
abstract member DeletePermissionAsync : string * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Permission>>
override this.DeletePermissionAsync : string * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Permission>>
Public Function DeletePermissionAsync (permissionLink As String, Optional options As RequestOptions = Nothing) As Task(Of ResourceResponse(Of Permission))

Parameters

permissionLink
String

The link of the Permission to delete. E.g. dbs/db_rid/users/user_rid/permissions/permission_rid/

options
RequestOptions

(Optional) The request options for the request.

Returns

A System.Threading.Tasks containing a ResourceResponse<TResource> which will contain information about the request issued.

Implements

Exceptions

If permissionLink is not set.

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:

StatusCodeReason for exception
404NotFound - This means the resource you tried to delete did not exist.

Examples

//Delete a permission using its selfLink property.
//To get the permissionLink you would have to query for the Permission object, using CreateStoredProcedureQuery(), and then refer to its .SelfLink property
await client.DeletePermissionAsync(permissionLink);

See also

Applies to