@NotThreadSafe public class DefaultPermissionChecker extends java.lang.Object implements PermissionChecker
| Constructor and Description |
|---|
DefaultPermissionChecker(InodeTree inodeTree)
Constructs a
PermissionChecker instance for Alluxio file system. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkInodeList(java.lang.String user,
java.util.List<java.lang.String> groups,
Mode.Bits bits,
java.lang.String path,
java.util.List<InodeView> inodeList,
boolean checkIsOwner)
This method provides basic permission checking logic on a list of inodes.
|
void |
checkParentPermission(Mode.Bits bits,
LockedInodePath inodePath)
Checks whether a user has permission to perform a specific action on the parent of the given
path; if parent directory does not exist, treats the closest ancestor directory of the path as
its parent and checks permission on it.
|
void |
checkPermission(Mode.Bits bits,
LockedInodePath inodePath)
Checks whether a user has permission to perform a specific action on a path.
|
void |
checkSetAttributePermission(LockedInodePath inodePath,
boolean superuserRequired,
boolean ownerRequired,
boolean writeRequired)
Checks whether a user has permission to edit the attribute of a given path.
|
Mode.Bits |
getPermission(LockedInodePath inodePath)
Gets the permission to access inodePath for the current client user.
|
public DefaultPermissionChecker(InodeTree inodeTree)
PermissionChecker instance for Alluxio file system.inodeTree - inode tree of the file system masterpublic void checkParentPermission(Mode.Bits bits, LockedInodePath inodePath) throws AccessControlException, InvalidPathException
PermissionCheckercheckParentPermission in interface PermissionCheckerbits - bits that capture the action Mode.Bits by userinodePath - the path to check permission onAccessControlException - if permission checking failsInvalidPathException - if the path is invalidpublic void checkPermission(Mode.Bits bits, LockedInodePath inodePath) throws AccessControlException
PermissionCheckercheckPermission in interface PermissionCheckerbits - bits that capture the action Mode.Bits by userinodePath - the path to check permission onAccessControlException - if permission checking failspublic Mode.Bits getPermission(LockedInodePath inodePath)
PermissionCheckergetPermission in interface PermissionCheckerinodePath - the inode pathpublic void checkSetAttributePermission(LockedInodePath inodePath, boolean superuserRequired, boolean ownerRequired, boolean writeRequired) throws AccessControlException, InvalidPathException
PermissionCheckercheckSetAttributePermission in interface PermissionCheckerinodePath - the path to check permission onsuperuserRequired - indicates whether it requires to be the superuserownerRequired - indicates whether it requires to be the owner of this pathwriteRequired - indicates whether it requires to have write permissionsAccessControlException - if permission checking failsInvalidPathException - if the path is invalidprotected void checkInodeList(java.lang.String user,
java.util.List<java.lang.String> groups,
Mode.Bits bits,
java.lang.String path,
java.util.List<InodeView> inodeList,
boolean checkIsOwner)
throws AccessControlException
user - who requests access permissiongroups - in which user belongs tobits - bits that capture the action Mode.Bits by userpath - the path to check permission oninodeList - file info list of all the inodes retrieved by traversing the pathcheckIsOwner - indicates whether to check the user is the owner of the pathAccessControlException - if permission checking failsCopyright © 2019. All Rights Reserved.