Package com.azure.storage.common.sas
Class AccountSasPermission
java.lang.Object
com.azure.storage.common.sas.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.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Returns the process messages permission, this allows the retrieval and deletion of queue messages.boolean
boolean
boolean
Returns the update permission status, it allows the update of queue message and tables.boolean
static AccountSasPermission
Creates anAccountSasPermission
from the specified permissions string.setAddPermission
(boolean hasAddPermission) Sets the add permission status.setCreatePermission
(boolean hasCreatePermission) Sets the create permission status.setDeletePermission
(boolean hasDeletePermission) Sets the delete permission status.setDeleteVersionPermission
(boolean hasDeleteVersionPermission) Sets the delete version permission status.setFilterTagsPermission
(boolean filterTagsPermission) Sets the filter tags permission status.setImmutabilityPolicyPermission
(boolean immutabilityPolicyPermission) Sets the set immutability policy permission status.setListPermission
(boolean hasListPermission) Sets the list permission status.setPermanentDeletePermission
(boolean permanentDeletePermission) Sets the permanent delete permission status.setProcessMessages
(boolean hasProcessMessagesPermission) Sets the process messages permission, this allows the retrieval and deletion of queue messages.setReadPermission
(boolean hasReadPermission) Sets the read permission status.setTagsPermission
(boolean tagsPermission) Sets the tags permission status.setUpdatePermission
(boolean hasUpdatePermission) Sets the update permission status, it allows the update of queue messages and tables.setWritePermission
(boolean hasWritePermission) Sets the write permission status.toString()
Converts the given permissions to aString
.
-
Constructor Details
-
AccountSasPermission
public AccountSasPermission()Initializes anAccountSasPermission
object with all fields set to false.
-
-
Method Details
-
parse
Creates anAccountSasPermission
from the specified permissions string. This method will throw anIllegalArgumentException
if it encounters a character that does not correspond to a valid permission.- Parameters:
permissionString
- AString
which represents theAccountSasPermission
.- Returns:
- An
AccountSasPermission
object generated from the givenString
. - Throws:
IllegalArgumentException
- IfpermString
contains a character other than r, w, d, x, l, a, c, u, p, t, f or i.
-
hasReadPermission
public boolean hasReadPermission()- Returns:
- the read permission status
-
setReadPermission
Sets the read permission status.- Parameters:
hasReadPermission
- Permission status to set- Returns:
- the updated AccountSasPermission object
-
hasAddPermission
public boolean hasAddPermission()- Returns:
- the add permission status
-
setAddPermission
Sets the add permission status.- Parameters:
hasAddPermission
- Permission status to set- Returns:
- the updated AccountSasPermission object
-
hasCreatePermission
public boolean hasCreatePermission()- Returns:
- the create permission status
-
setCreatePermission
Sets the create permission status.- Parameters:
hasCreatePermission
- Permission status to set- Returns:
- the updated AccountSasPermission object
-
hasWritePermission
public boolean hasWritePermission()- Returns:
- the write permission status
-
setWritePermission
Sets the write permission status.- Parameters:
hasWritePermission
- Permission status to set- Returns:
- the updated AccountSasPermission object
-
hasDeletePermission
public boolean hasDeletePermission()- Returns:
- the delete permission status
-
setDeletePermission
Sets the delete permission status.- Parameters:
hasDeletePermission
- Permission status to set- Returns:
- the updated AccountSasPermission object
-
hasDeleteVersionPermission
public boolean hasDeleteVersionPermission()- Returns:
- the delete version permission status
-
setDeleteVersionPermission
Sets the delete version permission status.- Parameters:
hasDeleteVersionPermission
- Permission status to set- Returns:
- the updated AccountSasPermission object
-
hasPermanentDeletePermission
public boolean hasPermanentDeletePermission()- Returns:
- the permanent delete permission status.
-
setPermanentDeletePermission
Sets the permanent delete permission status.- Parameters:
permanentDeletePermission
- Permission status to set- Returns:
- the updated AccountSasPermission object.
-
hasListPermission
public boolean hasListPermission()- Returns:
- the list permission status
-
setListPermission
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
-
hasUpdatePermission
public boolean hasUpdatePermission()Returns the update permission status, it allows the update of queue message and tables.- Returns:
- the update permission status
-
setUpdatePermission
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
-
hasProcessMessages
public boolean hasProcessMessages()Returns the process messages permission, this allows the retrieval and deletion of queue messages.- Returns:
- the process messages permission status.
-
setProcessMessages
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
-
hasTagsPermission
public boolean hasTagsPermission()- Returns:
- the tags permission status.
-
setTagsPermission
Sets the tags permission status.- Parameters:
tagsPermission
- Permission status to set- Returns:
- the updated AccountSasPermission object.
-
hasFilterTagsPermission
public boolean hasFilterTagsPermission()- Returns:
- the filter tags permission status.
-
setFilterTagsPermission
Sets the filter tags permission status.- Parameters:
filterTagsPermission
- Permission status to set- Returns:
- the updated AccountSasPermission object.
-
hasImmutabilityPolicyPermission
public boolean hasImmutabilityPolicyPermission()- Returns:
- the set immutability policy permission status.
-
setImmutabilityPolicyPermission
Sets the set immutability policy permission status.- Parameters:
immutabilityPolicyPermission
- Permission status to set- Returns:
- the updated AccountSasPermission object.
-
toString
Converts the given permissions to aString
. Using this method will guarantee the permissions are in an order accepted by the service.- Overrides:
toString
in classObject
- Returns:
- A
String
which represents theAccountSasPermission
.
-