TableSasPermission Class
- java.
lang. Object - com.
azure. data. tables. sas. TableSasPermission
- com.
public final class TableSasPermission
Constructs a string representing the permissions granted by an Azure Service SAS to a table. 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 setPermissions(TableSasPermission permissions) TableSasSignatureValues}.
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 |
---|---|
TableSasPermission() |
Creates an TableSasPermission with all fields set to false. |
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean |
hasAddPermission()
Gets the add permission status. |
boolean |
hasDeletePermission()
Gets the delete permission status. |
boolean |
hasReadPermission()
Gets the read permissions status. |
boolean |
hasUpdatePermission()
Gets the update permission status. |
static
Table |
parse(String permString)
Creates a TableSasPermission from the specified permissions string. |
Table |
setAddPermission(boolean hasAddPermission)
Sets the add permission status. |
Table |
setDeletePermission(boolean hasDeletePermission)
Sets the process permission status. |
Table |
setReadPermission(boolean hasReadPermission)
Sets the read permission status. |
Table |
setUpdatePermission(boolean hasUpdatePermission)
Sets the update permission status. |
String |
toString()
Converts the given permissions to a |
Methods inherited from java.lang.Object
Constructor Details
TableSasPermission
public TableSasPermission()
Creates an TableSasPermission with all fields set to false.
Method Details
hasAddPermission
public boolean hasAddPermission()
Gets the add permission status.
Returns:
true
if the SAS has permission to add entities to the table. false
, otherwise.hasDeletePermission
public boolean hasDeletePermission()
Gets the delete permission status.
Returns:
true
if the SAS has permission to delete entities from the table. false
, otherwise.hasReadPermission
public boolean hasReadPermission()
Gets the read permissions status.
Returns:
true
if the SAS has permission to get entities and query entities. false
, otherwise.hasUpdatePermission
public boolean hasUpdatePermission()
Gets the update permission status.
Returns:
true
if the SAS has permission to update entities in the table. false
, otherwise.parse
public static TableSasPermission parse(String permString)
Creates a TableSasPermission 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:
Returns:
String
.setAddPermission
public TableSasPermission setAddPermission(boolean hasAddPermission)
Sets the add permission status.
Parameters:
true
if the SAS has permission to add entities to the table. false
,
otherwise.
Note: The add
and update
permissions are required for upsert operations.
Returns:
setDeletePermission
public TableSasPermission setDeletePermission(boolean hasDeletePermission)
Sets the process permission status.
Parameters:
true
if the SAS has permission to delete entities from the table.
false
, otherwise.
Returns:
setReadPermission
public TableSasPermission setReadPermission(boolean hasReadPermission)
Sets the read permission status.
Parameters:
true
if the SAS has permission to get entities and query entities.
false
, otherwise
Returns:
setUpdatePermission
public TableSasPermission setUpdatePermission(boolean hasUpdatePermission)
Sets the update permission status.
Note: The add
and update
permissions are required for upsert operations.
Parameters:
true
if the SAS has permission to update entities in the table. false
,
otherwise.
Returns:
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. If all permissions are set to false, an empty string is returned from this method.
Overrides:
TableSasPermission.toString()Returns:
String
which represents the TableSasPermission.Applies to
Azure SDK for Java