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

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

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

origin: org.apache.hadoop/hadoop-hdfs

private static void checkWritePermission(FSPermissionChecker pc,
  CachePool pool) throws AccessControlException {
 if ((pc != null)) {
  pc.checkPermission(pool, FsAction.WRITE);
 }
}
origin: org.apache.hadoop/hadoop-hdfs

 void checkPermission(INodeDirectory inode, int snapshotId, FsAction access)
   throws AccessControlException {
  if (dir != null && dir.isPermissionEnabled()
    && pc != null && !pc.isSuperUser()) {
   pc.checkPermission(inode, snapshotId, access);
  }
 }
}
origin: org.apache.hadoop/hadoop-hdfs

/**
 * Check whether current user have permissions to access the path. For more
 * details of the parameters, see
 * {@link FSPermissionChecker#checkPermission}.
 */
void checkPermission(FSPermissionChecker pc, INodesInPath iip,
  boolean doCheckOwner, FsAction ancestorAccess, FsAction parentAccess,
  FsAction access, FsAction subAccess, boolean ignoreEmptyDir)
  throws AccessControlException {
 if (!pc.isSuperUser()) {
  readLock();
  try {
   pc.checkPermission(iip, doCheckOwner, ancestorAccess,
     parentAccess, access, subAccess, ignoreEmptyDir);
  } finally {
   readUnlock();
  }
 }
}
origin: org.apache.hadoop/hadoop-hdfs

if (pc != null) {
 try {
  pc.checkPermission(curDirective.getPool(), FsAction.READ);
 } catch (AccessControlException e) {
  hasPermission = false;
origin: org.apache.hadoop/hadoop-hdfs

/**
 * Returns a CachePoolInfo describing this CachePool based on the permissions
 * of the calling user. Unprivileged users will see only minimal descriptive
 * information about the pool.
 * 
 * @param pc Permission checker to be used to validate the user's permissions,
 *          or null
 * @return CachePoolEntry describing this CachePool
 */
public CachePoolEntry getEntry(FSPermissionChecker pc) {
 boolean hasPermission = true;
 if (pc != null) {
  try {
   pc.checkPermission(this, FsAction.READ);
  } catch (AccessControlException e) {
   hasPermission = false;
  }
 }
 return new CachePoolEntry(getInfo(hasPermission), 
   hasPermission ? getStats() : new CachePoolStats.Builder().build());
}
origin: ch.cern.hadoop/hadoop-hdfs

private static void checkWritePermission(FSPermissionChecker pc,
  CachePool pool) throws AccessControlException {
 if ((pc != null)) {
  pc.checkPermission(pool, FsAction.WRITE);
 }
}
origin: io.prestosql.hadoop/hadoop-apache

private static void checkWritePermission(FSPermissionChecker pc,
  CachePool pool) throws AccessControlException {
 if ((pc != null)) {
  pc.checkPermission(pool, FsAction.WRITE);
 }
}
origin: org.apache.hadoop/hadoop-hdfs

 checkSimpleTraverse(iip);
} else {
 pc.checkPermission(iip, false, null, null, null, null, false);
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Check whether current user have permissions to access the path. For more
 * details of the parameters, see
 * {@link FSPermissionChecker#checkPermission}.
 */
void checkPermission(FSPermissionChecker pc, INodesInPath iip,
  boolean doCheckOwner, FsAction ancestorAccess, FsAction parentAccess,
  FsAction access, FsAction subAccess, boolean ignoreEmptyDir)
  throws AccessControlException {
 if (!pc.isSuperUser()) {
  readLock();
  try {
   pc.checkPermission(iip, doCheckOwner, ancestorAccess,
     parentAccess, access, subAccess, ignoreEmptyDir);
  } finally {
   readUnlock();
  }
 }
}
origin: io.prestosql.hadoop/hadoop-apache

/**
 * Check whether current user have permissions to access the path. For more
 * details of the parameters, see
 * {@link FSPermissionChecker#checkPermission}.
 */
void checkPermission(FSPermissionChecker pc, INodesInPath iip,
  boolean doCheckOwner, FsAction ancestorAccess, FsAction parentAccess,
  FsAction access, FsAction subAccess, boolean ignoreEmptyDir)
  throws AccessControlException {
 if (!pc.isSuperUser()) {
  readLock();
  try {
   pc.checkPermission(iip, doCheckOwner, ancestorAccess,
     parentAccess, access, subAccess, ignoreEmptyDir);
  } finally {
   readUnlock();
  }
 }
}
origin: com.facebook.hadoop/hadoop-core

readLock();
try {
 pc.checkPermission(path, inodes, doCheckOwner,
  ancestorAccess, parentAccess, access, subAccess);
} catch (AccessControlException e) {
origin: ch.cern.hadoop/hadoop-hdfs

private void assertPermissionGranted(UserGroupInformation user, String path,
  FsAction access) throws IOException {
 INodesInPath iip = dir.getINodesInPath(path, true);
 dir.getPermissionChecker(SUPERUSER, SUPERGROUP, user).checkPermission(iip,
  false, null, null, access, null, false);
}
origin: ch.cern.hadoop/hadoop-hdfs

private void assertPermissionDenied(UserGroupInformation user, String path,
  FsAction access) throws IOException {
 try {
  INodesInPath iip = dir.getINodesInPath(path, true);
  dir.getPermissionChecker(SUPERUSER, SUPERGROUP, user).checkPermission(iip,
   false, null, null, access, null, false);
  fail("expected AccessControlException for user + " + user + ", path = " +
   path + ", access = " + access);
 } catch (AccessControlException e) {
  assertTrue("Permission denied messages must carry the username",
      e.getMessage().contains(user.getUserName().toString()));
  assertTrue("Permission denied messages must carry the path parent",
      e.getMessage().contains(
        new Path(path).getParent().toUri().getPath()));
 }
}
origin: io.prestosql.hadoop/hadoop-apache

if (pc != null) {
 try {
  pc.checkPermission(curDirective.getPool(), FsAction.READ);
 } catch (AccessControlException e) {
  hasPermission = false;
origin: ch.cern.hadoop/hadoop-hdfs

if (pc != null) {
 try {
  pc.checkPermission(curDirective.getPool(), FsAction.READ);
 } catch (AccessControlException e) {
  hasPermission = false;
origin: io.prestosql.hadoop/hadoop-apache

/**
 * Returns a CachePoolInfo describing this CachePool based on the permissions
 * of the calling user. Unprivileged users will see only minimal descriptive
 * information about the pool.
 * 
 * @param pc Permission checker to be used to validate the user's permissions,
 *          or null
 * @return CachePoolEntry describing this CachePool
 */
public CachePoolEntry getEntry(FSPermissionChecker pc) {
 boolean hasPermission = true;
 if (pc != null) {
  try {
   pc.checkPermission(this, FsAction.READ);
  } catch (AccessControlException e) {
   hasPermission = false;
  }
 }
 return new CachePoolEntry(getInfo(hasPermission), 
   hasPermission ? getStats() : new CachePoolStats.Builder().build());
}
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Returns a CachePoolInfo describing this CachePool based on the permissions
 * of the calling user. Unprivileged users will see only minimal descriptive
 * information about the pool.
 * 
 * @param pc Permission checker to be used to validate the user's permissions,
 *          or null
 * @return CachePoolEntry describing this CachePool
 */
public CachePoolEntry getEntry(FSPermissionChecker pc) {
 boolean hasPermission = true;
 if (pc != null) {
  try {
   pc.checkPermission(this, FsAction.READ);
  } catch (AccessControlException e) {
   hasPermission = false;
  }
 }
 return new CachePoolEntry(getInfo(hasPermission), 
   hasPermission ? getStats() : new CachePoolStats.Builder().build());
}
org.apache.hadoop.hdfs.server.namenodeFSPermissionCheckercheckPermission

Javadoc

Check whether current user have permissions to access the path. Traverse is always checked. Parent path means the parent directory for the path. Ancestor path means the last (the closest) existing ancestor directory of the path. Note that if the parent path exists, then the parent path and the ancestor path are the same. For example, suppose the path is "/foo/bar/baz". No matter baz is a file or a directory, the parent path is "/foo/bar". If bar exists, then the ancestor path is also "/foo/bar". If bar does not exist and foo exists, then the ancestor path is "/foo". Further, if both foo and bar do not exist, then the ancestor path is "/".

Popular methods of FSPermissionChecker

  • <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
  • hasAclPermission
    Checks requested access against an Access Control List. This method relies on finding the ACL data i
  • getUser,
  • hasAclPermission,
  • hasPermission,
  • isSuperUser,
  • toAccessControlString,
  • constructPath,
  • containsGroup,
  • isMemberOfGroup,
  • checkIsDirectory

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JFileChooser (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top plugins for WebStorm
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