public class FSPermissionChecker extends Object implements INodeAttributeProvider.AccessControlEnforcer
FSNamesystem.readLock()
.Modifier | Constructor and Description |
---|---|
protected |
FSPermissionChecker(String fsOwner,
String supergroup,
org.apache.hadoop.security.UserGroupInformation callerUgi,
INodeAttributeProvider attributeProvider) |
Modifier and Type | Method and Description |
---|---|
void |
checkPermission(org.apache.hadoop.hdfs.server.namenode.CachePool pool,
org.apache.hadoop.fs.permission.FsAction access)
Whether a cache pool can be accessed by the current context
|
void |
checkPermission(String fsOwner,
String supergroup,
org.apache.hadoop.security.UserGroupInformation callerUgi,
org.apache.hadoop.hdfs.server.namenode.INodeAttributes[] inodeAttrs,
org.apache.hadoop.hdfs.server.namenode.INode[] inodes,
byte[][] components,
int snapshotId,
String path,
int ancestorIndex,
boolean doCheckOwner,
org.apache.hadoop.fs.permission.FsAction ancestorAccess,
org.apache.hadoop.fs.permission.FsAction parentAccess,
org.apache.hadoop.fs.permission.FsAction access,
org.apache.hadoop.fs.permission.FsAction subAccess,
boolean ignoreEmptyDir)
Checks permission on a file system object.
|
void |
checkSuperuserPrivilege()
Verify if the caller has the required permission.
|
INodeAttributeProvider |
getAttributesProvider() |
String |
getUser() |
boolean |
isMemberOfGroup(String group) |
boolean |
isSuperUser() |
protected FSPermissionChecker(String fsOwner, String supergroup, org.apache.hadoop.security.UserGroupInformation callerUgi, INodeAttributeProvider attributeProvider)
public boolean isMemberOfGroup(String group)
public String getUser()
public boolean isSuperUser()
public INodeAttributeProvider getAttributesProvider()
public void checkSuperuserPrivilege() throws org.apache.hadoop.security.AccessControlException
org.apache.hadoop.security.AccessControlException
public void checkPermission(String fsOwner, String supergroup, org.apache.hadoop.security.UserGroupInformation callerUgi, org.apache.hadoop.hdfs.server.namenode.INodeAttributes[] inodeAttrs, org.apache.hadoop.hdfs.server.namenode.INode[] inodes, byte[][] components, int snapshotId, String path, int ancestorIndex, boolean doCheckOwner, org.apache.hadoop.fs.permission.FsAction ancestorAccess, org.apache.hadoop.fs.permission.FsAction parentAccess, org.apache.hadoop.fs.permission.FsAction access, org.apache.hadoop.fs.permission.FsAction subAccess, boolean ignoreEmptyDir) throws org.apache.hadoop.security.AccessControlException
INodeAttributeProvider.AccessControlEnforcer
checkPermission
in interface INodeAttributeProvider.AccessControlEnforcer
fsOwner
- Filesystem owner (The Namenode user)supergroup
- super user geoupcallerUgi
- UserGroupInformation of the callerinodeAttrs
- Array of INode attributes for each path element in the
the pathinodes
- Array of INodes for each path element in the pathcomponents
- Array of byte arrays of the LocalNamesnapshotId
- the snapshotId of the requested pathpath
- Path StringancestorIndex
- Index of ancestordoCheckOwner
- perform ownership checkancestorAccess
- The access required by the ancestor of the path.parentAccess
- The access required by the parent of the path.access
- The access required by the path.subAccess
- If path is a directory, It is the access required of
the path and all the sub-directories. If path is not a
directory, there should ideally be no effect.ignoreEmptyDir
- Ignore permission checking for empty directory?org.apache.hadoop.security.AccessControlException
public void checkPermission(org.apache.hadoop.hdfs.server.namenode.CachePool pool, org.apache.hadoop.fs.permission.FsAction access) throws org.apache.hadoop.security.AccessControlException
pool
- CachePool being accessedaccess
- type of action being performed on the cache poolorg.apache.hadoop.security.AccessControlException
- if pool cannot be accessedCopyright © 2018 Apache Software Foundation. All Rights Reserved.