Delen via


AccountSasPermission Class

  • java.lang.Object
    • com.azure.storage.common.sas.AccountSasPermission

public final class AccountSasPermission

This is a helper class to construct a string representing the permissions granted by an Account SAS. Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the values are set, this should be serialized with toString and set as the permissions field on AccountSasSignatureValues.

It is possible to construct the permissions string without this class, but the order of the permissions is particular and this class guarantees correctness.

Constructor Summary

Constructor Description
AccountSasPermission()

Initializes an AccountSasPermission object with all fields set to false.

Method Summary

Modifier and Type Method and Description
boolean hasAddPermission()

Whether add permission has been set.

boolean hasCreatePermission()

Whether create permission has been set.

boolean hasDeletePermission()

Whether delete permission has been set.

boolean hasDeleteVersionPermission()

Whether delete version permission has been set.

boolean hasFilterTagsPermission()

Whether filter tags permission has been set.

boolean hasImmutabilityPolicyPermission()

Whether immutability policy permissions has been set.

boolean hasListPermission()

Whether list permission has been set.

boolean hasPermanentDeletePermission()

Whether permanent delete permission has been set.

boolean hasProcessMessages()

Returns the process messages permission, this allows the retrieval and deletion of queue messages.

boolean hasReadPermission()

Whether read permission has been set.

boolean hasTagsPermission()

Whether tags permissions has been set.

boolean hasUpdatePermission()

Returns the update permission status, it allows the update of queue message and tables.

boolean hasWritePermission()

Whether write permission has been set.

static AccountSasPermission parse(String permissionString)

Creates an AccountSasPermission from the specified permissions string.

AccountSasPermission setAddPermission(boolean hasAddPermission)

Sets the add permission status.

AccountSasPermission setCreatePermission(boolean hasCreatePermission)

Sets the create permission status.

AccountSasPermission setDeletePermission(boolean hasDeletePermission)

Sets the delete permission status.

AccountSasPermission setDeleteVersionPermission(boolean hasDeleteVersionPermission)

Sets the delete version permission status.

AccountSasPermission setFilterTagsPermission(boolean filterTagsPermission)

Sets the filter tags permission status.

AccountSasPermission setImmutabilityPolicyPermission(boolean immutabilityPolicyPermission)

Sets the set immutability policy permission status.

AccountSasPermission setListPermission(boolean hasListPermission)

Sets the list permission status.

AccountSasPermission setPermanentDeletePermission(boolean permanentDeletePermission)

Sets the permanent delete permission status.

AccountSasPermission setProcessMessages(boolean hasProcessMessagesPermission)

Sets the process messages permission, this allows the retrieval and deletion of queue messages.

AccountSasPermission setReadPermission(boolean hasReadPermission)

Sets the read permission status.

AccountSasPermission setTagsPermission(boolean tagsPermission)

Sets the tags permission status.

AccountSasPermission setUpdatePermission(boolean hasUpdatePermission)

Sets the update permission status, it allows the update of queue messages and tables.

AccountSasPermission setWritePermission(boolean hasWritePermission)

Sets the write permission status.

String toString()

Converts the given permissions to a String.

Methods inherited from java.lang.Object

Constructor Details

AccountSasPermission

public AccountSasPermission()

Initializes an AccountSasPermission object with all fields set to false.

Method Details

hasAddPermission

public boolean hasAddPermission()

Whether add permission has been set.

Returns:

the add permission status

hasCreatePermission

public boolean hasCreatePermission()

Whether create permission has been set.

Returns:

the create permission status

hasDeletePermission

public boolean hasDeletePermission()

Whether delete permission has been set.

Returns:

the delete permission status

hasDeleteVersionPermission

public boolean hasDeleteVersionPermission()

Whether delete version permission has been set.

Returns:

the delete version permission status

hasFilterTagsPermission

public boolean hasFilterTagsPermission()

Whether filter tags permission has been set.

Returns:

the filter tags permission status.

hasImmutabilityPolicyPermission

public boolean hasImmutabilityPolicyPermission()

Whether immutability policy permissions has been set.

Returns:

the set immutability policy permission status.

hasListPermission

public boolean hasListPermission()

Whether list permission has been set.

Returns:

the list permission status

hasPermanentDeletePermission

public boolean hasPermanentDeletePermission()

Whether permanent delete permission has been set.

Returns:

the permanent delete permission status.

hasProcessMessages

public boolean hasProcessMessages()

Returns the process messages permission, this allows the retrieval and deletion of queue messages.

Returns:

the process messages permission status.

hasReadPermission

public boolean hasReadPermission()

Whether read permission has been set.

Returns:

the read permission status

hasTagsPermission

public boolean hasTagsPermission()

Whether tags permissions has been set.

Returns:

the tags permission status.

hasUpdatePermission

public boolean hasUpdatePermission()

Returns the update permission status, it allows the update of queue message and tables.

Returns:

the update permission status

hasWritePermission

public boolean hasWritePermission()

Whether write permission has been set.

Returns:

the write permission status

parse

public static AccountSasPermission parse(String permissionString)

Creates an AccountSasPermission from the specified permissions string. This method will throw an IllegalArgumentException if it encounters a character that does not correspond to a valid permission.

Parameters:

permissionString - A String which represents the AccountSasPermission.

Returns:

An AccountSasPermission object generated from the given String.

setAddPermission

public AccountSasPermission setAddPermission(boolean hasAddPermission)

Sets the add permission status.

Parameters:

hasAddPermission - Permission status to set

Returns:

the updated AccountSasPermission object

setCreatePermission

public AccountSasPermission setCreatePermission(boolean hasCreatePermission)

Sets the create permission status.

Parameters:

hasCreatePermission - Permission status to set

Returns:

the updated AccountSasPermission object

setDeletePermission

public AccountSasPermission setDeletePermission(boolean hasDeletePermission)

Sets the delete permission status.

Parameters:

hasDeletePermission - Permission status to set

Returns:

the updated AccountSasPermission object

setDeleteVersionPermission

public AccountSasPermission setDeleteVersionPermission(boolean hasDeleteVersionPermission)

Sets the delete version permission status.

Parameters:

hasDeleteVersionPermission - Permission status to set

Returns:

the updated AccountSasPermission object

setFilterTagsPermission

public AccountSasPermission setFilterTagsPermission(boolean filterTagsPermission)

Sets the filter tags permission status.

Parameters:

filterTagsPermission - Permission status to set

Returns:

the updated AccountSasPermission object.

setImmutabilityPolicyPermission

public AccountSasPermission setImmutabilityPolicyPermission(boolean immutabilityPolicyPermission)

Sets the set immutability policy permission status.

Parameters:

immutabilityPolicyPermission - Permission status to set

Returns:

the updated AccountSasPermission object.

setListPermission

public AccountSasPermission setListPermission(boolean hasListPermission)

Sets the list permission status. This permission grants the ability to list blob containers, blobs, shares, directories, and files.

Parameters:

hasListPermission - Permission status to set

Returns:

the updated AccountSasPermission object

setPermanentDeletePermission

public AccountSasPermission setPermanentDeletePermission(boolean permanentDeletePermission)

Sets the permanent delete permission status.

Parameters:

permanentDeletePermission - Permission status to set

Returns:

the updated AccountSasPermission object.

setProcessMessages

public AccountSasPermission setProcessMessages(boolean hasProcessMessagesPermission)

Sets the process messages permission, this allows the retrieval and deletion of queue messages.

Parameters:

hasProcessMessagesPermission - Permission status to set

Returns:

the updated AccountSasPermission object

setReadPermission

public AccountSasPermission setReadPermission(boolean hasReadPermission)

Sets the read permission status.

Parameters:

hasReadPermission - Permission status to set

Returns:

the updated AccountSasPermission object

setTagsPermission

public AccountSasPermission setTagsPermission(boolean tagsPermission)

Sets the tags permission status.

Parameters:

tagsPermission - Permission status to set

Returns:

the updated AccountSasPermission object.

setUpdatePermission

public AccountSasPermission setUpdatePermission(boolean hasUpdatePermission)

Sets the update permission status, it allows the update of queue messages and tables.

Parameters:

hasUpdatePermission - Permission status to set

Returns:

the updated AccountSasPermission object

setWritePermission

public AccountSasPermission setWritePermission(boolean hasWritePermission)

Sets the write permission status.

Parameters:

hasWritePermission - Permission status to set

Returns:

the updated AccountSasPermission object

toString

public String toString()

Converts the given permissions to a String. Using this method will guarantee the permissions are in an order accepted by the service.

Overrides:

AccountSasPermission.toString()

Returns:

A String which represents the AccountSasPermission.

Applies to