ShareClient.SetAccessPolicy Method

Definition

The SetAccessPolicy(IEnumerable<ShareSignedIdentifier>, ShareFileRequestConditions, CancellationToken) operation sets the permissions for the specified share. The permissions indicate whether share data may be accessed publicly.

For more information, see Set Share ACL.

public virtual Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo> SetAccessPolicy (System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.ShareSignedIdentifier> permissions, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SetAccessPolicy : seq<Azure.Storage.Files.Shares.Models.ShareSignedIdentifier> * Azure.Storage.Files.Shares.Models.ShareFileRequestConditions * System.Threading.CancellationToken -> Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo>
override this.SetAccessPolicy : seq<Azure.Storage.Files.Shares.Models.ShareSignedIdentifier> * Azure.Storage.Files.Shares.Models.ShareFileRequestConditions * System.Threading.CancellationToken -> Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo>
Public Overridable Function SetAccessPolicy (permissions As IEnumerable(Of ShareSignedIdentifier), Optional conditions As ShareFileRequestConditions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of ShareInfo)

Parameters

permissions
IEnumerable<ShareSignedIdentifier>

Stored access policies that you can use to provide fine grained control over share permissions.

conditions
ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on setting the access policy.

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

A Response<T> describing the updated share.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to