public class PathAccessControlEntry extends Object
The value is a comma-separated list of access control entries, each access control entry (ACE) consists of four elements in the format "[scope:][type]:[id]:[permissions]":
The scope must be "default" to indicate the ACE belongs to the default Access Control List (ACL) for a directory; otherwise scope is implicit and the ACE belongs to the access ACL.
There are four ACE types:
The user or group identifier is omitted for entries of type "mask" and "other". The user or group identifier is also omitted for the owner and owning group.
The permission field is a 3-character sequence where the first character is 'r' to grant read access, the second character is 'w' to grant write access, and the third character is 'x' to grant execute permission. If access is not granted, the '-' character is used to denote that the permission is denied.
For example, the following ACL grants read, write, and execute rights to the file owner and john.doe@contoso, the read right to the owning group, and nothing to everyone else: "user::rwx,user:john.doe@contoso:rwx,group::r--,other::---,mask::rwx".
Constructor and Description |
---|
PathAccessControlEntry()
Initializes an empty instance of
PathAccessControlEntry . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
AccessControlType |
getAccessControlType()
Returns the
AccessControlType for this entry. |
String |
getEntityId()
The Azure AAD Object ID or User Principal Name that is associated with this entry.
|
RolePermissions |
getPermissions()
Returns the symbolic form of the permissions for this entry.
|
int |
hashCode() |
boolean |
isInDefaultScope()
Returns whether this ACE is in the default scope.
|
static PathAccessControlEntry |
parse(String str)
Parses the provided string into a
List<{@link PathAccessControlEntry}> . |
static List<PathAccessControlEntry> |
parseList(String str)
Deserializes an ACL to the format "user::rwx,user:john.doe@contoso:rwx,group::r--,other::---,mask=rwx"
|
static String |
serializeList(List<PathAccessControlEntry> acl)
Converts the Access Control List to a
String . |
PathAccessControlEntry |
setAccessControlType(AccessControlType accessControlType)
Sets the
AccessControlType for this entry. |
PathAccessControlEntry |
setDefaultScope(boolean defaultScope)
Sets whether or not this entry is the default for a directory.
|
PathAccessControlEntry |
setEntityId(String entityId)
Sets the entity ID to which this entry will apply.
|
PathAccessControlEntry |
setPermissions(RolePermissions permissions)
Sets the permissions for this entry.
|
String |
toString() |
public PathAccessControlEntry()
PathAccessControlEntry
. Constructs an empty instance of
RolePermissions
for the permissions field.public static PathAccessControlEntry parse(String str)
List<{@link PathAccessControlEntry}>
.
Must be of the format "[scope:][type]:[id]:[permissions]".str
- The string representation of the ACL.IllegalArgumentException
- if the String provided does not match the format.public static String serializeList(List<PathAccessControlEntry> acl)
String
. The format is specified in the description of this type.acl
- The Access Control List to serialize.String
representing the serialized Access Control Listpublic static List<PathAccessControlEntry> parseList(String str)
str
- The String
representation of the ACL.java.util.List
public boolean isInDefaultScope()
true
if in the default scope and false
otherwise.public AccessControlType getAccessControlType()
AccessControlType
for this entry.AccessControlType
for this entry.public String getEntityId()
public RolePermissions getPermissions()
RolePermissions
for this entry.public PathAccessControlEntry setDefaultScope(boolean defaultScope)
defaultScope
- true
to set as the default scope and false
otherwise.public PathAccessControlEntry setAccessControlType(AccessControlType accessControlType)
AccessControlType
for this entry.accessControlType
- The AccessControlType
for this entry.public PathAccessControlEntry setEntityId(String entityId)
AccessControlType.MASK
or
AccessControlType.OTHER
or if the user is the owner or the group is the owning group. Must be a valid
Azure AAD Object ID or User Principal Name.entityId
- The entity to which this entry will apply.public PathAccessControlEntry setPermissions(RolePermissions permissions)
permissions
- RolePermissions
to set for this entry.Copyright © 2020 Microsoft Corporation. All rights reserved.