Tabnine Logo
DefaultAccessControlList.getEntries
Code IndexAdd Tabnine to your IDE (free)

How to use
getEntries
method
in
alluxio.security.authorization.DefaultAccessControlList

Best Java code snippets using alluxio.security.authorization.DefaultAccessControlList.getEntries (Showing top 3 results out of 315)

origin: Alluxio/alluxio

private void setUfsAcl(LockedInodePath inodePath)
  throws InvalidPathException, AccessControlException {
 Inode inode = inodePath.getInodeOrNull();
 checkUfsMode(inodePath.getUri(), OperationType.WRITE);
 MountTable.Resolution resolution = mMountTable.resolve(inodePath.getUri());
 String ufsUri = resolution.getUri().toString();
 try (CloseableResource<UnderFileSystem> ufsResource = resolution.acquireUfsResource()) {
  UnderFileSystem ufs = ufsResource.get();
  if (ufs.isObjectStorage()) {
   LOG.warn("SetACL is not supported to object storage UFS via Alluxio. "
     + "UFS: " + ufsUri + ". This has no effect on the underlying object.");
  } else {
   try {
    List<AclEntry> entries = new ArrayList<>(inode.getACL().getEntries());
    if (inode.isDirectory()) {
     entries.addAll(inode.asDirectory().getDefaultACL().getEntries());
    }
    ufs.setAclEntries(ufsUri, entries);
   } catch (IOException e) {
    throw new AccessControlException("Could not setAcl for UFS file: " + ufsUri);
   }
  }
 }
}
origin: Alluxio/alluxio

@Test
public void removeExtendedDefaultAclMask() throws Exception {
 mFileSystemMaster.createDirectory(NESTED_URI, CreateDirectoryContext
   .defaults(CreateDirectoryPOptions.newBuilder().setRecursive(true)));
 AclEntry newAcl = AclEntry.fromCliString("default:user:newuser:rwx");
 // Add an ACL
 addAcl(NESTED_URI, newAcl);
 assertThat(getInfo(NESTED_URI).getDefaultAcl().getEntries(), hasItem(newAcl));
 // Attempt to remove the ACL mask
 AclEntry maskEntry = AclEntry.fromCliString("default:mask::rwx");
 assertThat(getInfo(NESTED_URI).getDefaultAcl().getEntries(), hasItem(maskEntry));
 try {
  removeAcl(NESTED_URI, maskEntry);
  fail("Expected removing the mask from an extended ACL to fail");
 } catch (IOException e) {
  assertThat(e.getMessage(), containsString("mask"));
 }
 // Remove the extended ACL
 removeAcl(NESTED_URI, newAcl);
 // Now we can add and remove a mask
 addAcl(NESTED_URI, maskEntry);
 removeAcl(NESTED_URI, maskEntry);
}
origin: Alluxio/alluxio

createDirectoryContext.setDefaultAcl(defaultAcl.getEntries());
alluxio.security.authorizationDefaultAccessControlListgetEntries

Javadoc

Returns a list of AclEntry which represent this ACL instance. The mask will only be included if extended ACL entries exist.

Popular methods of DefaultAccessControlList

  • isEmpty
    Returns true if the default ACL is empty.
  • <init>
    Constructor to build a default ACL based on an access ACL.
  • toStringEntries
  • generateChildFileACL
    create a child file 's accessACL based on the default ACL.
  • setEmpty
  • equals
  • generateChildDirACL
    Creates a child directory's access ACL and default ACL based on the default ACL.
  • hasExtended
  • setEntry
  • setOwningGroup
  • setOwningUser
  • toString
  • setOwningUser,
  • toString,
  • updateMask

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • getSystemService (Context)
  • addToBackStack (FragmentTransaction)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Top Vim plugins
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