Tabnine Logo
FSPermissionChecker.hasPermission
Code IndexAdd Tabnine to your IDE (free)

How to use
hasPermission
method
in
org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker

Best Java code snippets using org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.hasPermission (Showing top 8 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

/** Guarded by {@link FSNamesystem#readLock()} */
private void check(INodeAttributes[] inodes, byte[][] components, int i,
  FsAction access) throws AccessControlException {
 INodeAttributes inode = (i >= 0) ? inodes[i] : null;
 if (inode != null && !hasPermission(inode, access)) {
  throw new AccessControlException(
    toAccessControlString(inode, getPath(components, 0, i), access));
 }
}
origin: org.apache.hadoop/hadoop-hdfs

if (!hasPermission(inodeAttr, access)) {
 throw new AccessControlException(
   toAccessControlString(inodeAttr, d.getFullPathName(), access));
origin: io.prestosql.hadoop/hadoop-apache

/** Guarded by {@link FSNamesystem#readLock()} */
private void check(INodeAttributes[] inodes, int i, FsAction access)
  throws AccessControlException {
 INodeAttributes inode = (i >= 0) ? inodes[i] : null;
 if (inode != null && !hasPermission(inode, access)) {
  throw new AccessControlException(
    toAccessControlString(inode, constructPath(inodes, i), access));
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/** Guarded by {@link FSNamesystem#readLock()} */
private void check(INodeAttributes[] inodes, int i, FsAction access)
  throws AccessControlException {
 INodeAttributes inode = (i >= 0) ? inodes[i] : null;
 if (inode != null && !hasPermission(inode, access)) {
  throw new AccessControlException(
    toAccessControlString(inode, constructPath(inodes, i), access));
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/** Guarded by {@link FSNamesystem#readLock()} */
private void checkSubAccess(byte[][] components, int pathIdx,
  INode inode, int snapshotId, FsAction access, boolean ignoreEmptyDir)
  throws AccessControlException {
 if (inode == null || !inode.isDirectory()) {
  return;
 }
 Stack<INodeDirectory> directories = new Stack<INodeDirectory>();
 for(directories.push(inode.asDirectory()); !directories.isEmpty(); ) {
  INodeDirectory d = directories.pop();
  ReadOnlyList<INode> cList = d.getChildrenList(snapshotId);
  if (!(cList.isEmpty() && ignoreEmptyDir)) {
   //TODO have to figure this out with inodeattribute provider
   INodeAttributes inodeAttr =
     getINodeAttrs(components, pathIdx, d, snapshotId);
   if (!hasPermission(inodeAttr, access)) {
    throw new AccessControlException(
      toAccessControlString(inodeAttr, d.getFullPathName(), access));
   }
  }
  for(INode child : cList) {
   if (child.isDirectory()) {
    directories.push(child.asDirectory());
   }
  }
 }
}
origin: io.prestosql.hadoop/hadoop-apache

/** Guarded by {@link FSNamesystem#readLock()} */
private void checkSubAccess(byte[][] components, int pathIdx,
  INode inode, int snapshotId, FsAction access, boolean ignoreEmptyDir)
  throws AccessControlException {
 if (inode == null || !inode.isDirectory()) {
  return;
 }
 Stack<INodeDirectory> directories = new Stack<INodeDirectory>();
 for(directories.push(inode.asDirectory()); !directories.isEmpty(); ) {
  INodeDirectory d = directories.pop();
  ReadOnlyList<INode> cList = d.getChildrenList(snapshotId);
  if (!(cList.isEmpty() && ignoreEmptyDir)) {
   //TODO have to figure this out with inodeattribute provider
   INodeAttributes inodeAttr =
     getINodeAttrs(components, pathIdx, d, snapshotId);
   if (!hasPermission(inodeAttr, access)) {
    throw new AccessControlException(
      toAccessControlString(inodeAttr, d.getFullPathName(), access));
   }
  }
  for(INode child : cList) {
   if (child.isDirectory()) {
    directories.push(child.asDirectory());
   }
  }
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/** Guarded by {@link FSNamesystem#readLock()} */
private void checkTraverse(INodeAttributes[] inodeAttrs, int last)
  throws AccessControlException {
 for (int i=0; i <= last; i++) {
  INodeAttributes inode = inodeAttrs[i];
  if (!inode.isDirectory()) {
   throw new AccessControlException(
     constructPath(inodeAttrs, i) + " (is not a directory)");
  }
  if (!hasPermission(inode, FsAction.EXECUTE)) {
   throw new AccessControlException(toAccessControlString(
     inode, constructPath(inodeAttrs, i), FsAction.EXECUTE));
  }
 }
}
origin: io.prestosql.hadoop/hadoop-apache

/** Guarded by {@link FSNamesystem#readLock()} */
private void checkTraverse(INodeAttributes[] inodeAttrs, int last)
  throws AccessControlException {
 for (int i=0; i <= last; i++) {
  INodeAttributes inode = inodeAttrs[i];
  if (!inode.isDirectory()) {
   throw new AccessControlException(
     constructPath(inodeAttrs, i) + " (is not a directory)");
  }
  if (!hasPermission(inode, FsAction.EXECUTE)) {
   throw new AccessControlException(toAccessControlString(
     inode, constructPath(inodeAttrs, i), FsAction.EXECUTE));
  }
 }
}
org.apache.hadoop.hdfs.server.namenodeFSPermissionCheckerhasPermission

Popular methods of FSPermissionChecker

  • checkPermission
    Check whether current user have permissions to access the path. Traverse is always checked. Parent p
  • <init>
  • check
    Guarded by FSNamesystem#readLock()
  • checkOwner
    Guarded by FSNamesystem#readLock()
  • checkSubAccess
    Guarded by FSNamesystem#readLock()
  • checkTraverse
    Guarded by FSNamesystem#readLock()
  • checkStickyBit
    Guarded by FSNamesystem#readLock()
  • checkSuperuserPrivilege
    Verify if the caller has the required permission. This will result into an exception if the caller i
  • getAccessControlEnforcer
  • getAttributesProvider
  • getINodeAttrs
  • getUser
  • getINodeAttrs,
  • getUser,
  • hasAclPermission,
  • isSuperUser,
  • toAccessControlString,
  • constructPath,
  • containsGroup,
  • isMemberOfGroup,
  • checkIsDirectory

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Collectors (java.util.stream)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now