你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

IDocumentClient.DeletePermissionAsync Method

Definition

Overloads

Name Description
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 in the Azure Cosmos DB service.

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>>
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.

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

DeletePermissionAsync(Uri, RequestOptions)

Delete a permission as an asynchronous operation in 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>>
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

(Optional) The RequestOptions for the request.

Returns

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

Applies to