Permission.ReadAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Reads a PermissionProperties from the Azure Cosmos service as an asynchronous operation. Each read will return a new ResourceToken with its respective expiration.
public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.PermissionResponse> ReadAsync (int? tokenExpiryInSeconds = default, Microsoft.Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ReadAsync : Nullable<int> * Microsoft.Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.PermissionResponse>
Public MustOverride Function ReadAsync (Optional tokenExpiryInSeconds As Nullable(Of Integer) = Nothing, Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PermissionResponse)
Parameters
(Optional) The expiry time for resource token in seconds. This value can range from 10 minutes (or 600 seconds), to 24 hours (or 86,400 seconds). The default value for this is 1 hour (or 3,600 seconds). This does not change the default value for future tokens.
- requestOptions
- RequestOptions
(Optional) The options for the permission request.
- cancellationToken
- CancellationToken
(Optional) CancellationToken representing request cancellation.
Returns
A Task containing a PermissionResponse which wraps a PermissionProperties containing the read resource record.
Examples
User user = this.database.GetUser("userId");
Permission permission= user.GetPermission("permissionId");
PermissionProperties permissionProperties = await permission.ReadAsync(tokenExpiryInSeconds: 9000);
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應