Tabnine Logo
AccessControlList.setEntry
Code IndexAdd Tabnine to your IDE (free)

How to use
setEntry
method
in
alluxio.security.authorization.AccessControlList

Best Java code snippets using alluxio.security.authorization.AccessControlList.setEntry (Showing top 8 results out of 315)

origin: Alluxio/alluxio

@Override
public void setEntry(AclEntry entry) {
 if (isEmpty() && mAccessAcl != null) {
  mMode = mAccessAcl.mMode;
 }
 super.setEntry(entry);
 setEmpty(false);
}
origin: Alluxio/alluxio

/**
 * Sets ACL entries into the internal ACL.
 * The entries will overwrite any existing correspondent entries in the internal ACL.
 *
 * @param entries the ACL entries
 * @return the updated object
 */
public T setAcl(List<AclEntry> entries) {
 if (entries == null || entries.isEmpty()) {
  return getThis();
 }
 for (AclEntry entry : entries) {
  if (entry.isDefault()) {
   getDefaultACL().setEntry(entry);
  } else {
   mAcl.setEntry(entry);
  }
 }
 updateMask(entries);
 return getThis();
}
origin: Alluxio/alluxio

acl.setEntry(aclEntry);
origin: Alluxio/alluxio

private void setPermissions(AccessControlList acl) {
 // owning user: rwx
 // owning group: r-x
 // other: --x
 // named user: r-x
 // named group: r--
 // named group 2: -wx
 acl.setOwningUser(OWNING_USER);
 acl.setOwningGroup(OWNING_GROUP);
 acl.setEntry(new AclEntry.Builder().setType(AclEntryType.OWNING_USER).setSubject(OWNING_USER)
   .addAction(AclAction.READ).addAction(AclAction.WRITE).addAction(AclAction.EXECUTE).build());
 acl.setEntry(new AclEntry.Builder().setType(AclEntryType.OWNING_GROUP).setSubject(OWNING_GROUP)
   .addAction(AclAction.READ).addAction(AclAction.EXECUTE).build());
 acl.setEntry(new AclEntry.Builder().setType(AclEntryType.OTHER)
   .addAction(AclAction.EXECUTE).build());
 acl.setEntry(new AclEntry.Builder().setType(AclEntryType.NAMED_USER).setSubject(NAMED_USER)
   .addAction(AclAction.READ).addAction(AclAction.EXECUTE).build());
 acl.setEntry(new AclEntry.Builder().setType(AclEntryType.NAMED_GROUP).setSubject(NAMED_GROUP)
   .addAction(AclAction.READ).build());
 acl.setEntry(new AclEntry.Builder().setType(AclEntryType.NAMED_GROUP).setSubject(NAMED_GROUP2)
   .addAction(AclAction.WRITE).addAction(AclAction.EXECUTE).build());
 acl.updateMask();
}
origin: Alluxio/alluxio

/**
 * Tests {@link AccessControlList#getMode()}.
 */
@Test
public void getMode() {
 AccessControlList acl = new AccessControlList();
 Assert.assertEquals(0, acl.getMode());
 acl.setEntry(new AclEntry.Builder().setType(AclEntryType.OWNING_USER).setSubject(OWNING_USER)
   .addAction(AclAction.READ).build());
 acl.setEntry(new AclEntry.Builder().setType(AclEntryType.OWNING_GROUP).setSubject(OWNING_GROUP)
   .addAction(AclAction.WRITE).build());
 acl.setEntry(new AclEntry.Builder().setType(AclEntryType.OTHER)
   .addAction(AclAction.EXECUTE).build());
 Assert.assertEquals(new Mode(Mode.Bits.READ, Mode.Bits.WRITE, Mode.Bits.EXECUTE).toShort(),
   acl.getMode());
}
origin: Alluxio/alluxio

/**
 * @param pAcl the proto representation
 * @return the {@link AccessControlList} instance created from the proto representation
 */
public static AccessControlList fromProto(PAcl pAcl) {
 AccessControlList acl;
 if (pAcl.getIsDefault()) {
  acl = new DefaultAccessControlList();
  ((DefaultAccessControlList) acl).setEmpty(pAcl.getIsDefaultEmpty());
 } else {
  acl = new AccessControlList();
 }
 acl.setOwningUser(pAcl.getOwner());
 acl.setOwningGroup(pAcl.getOwningGroup());
 acl.setMode((short) pAcl.getMode());
 if (pAcl.getEntriesCount() > 0) {
  for (PAclEntry tEntry : pAcl.getEntriesList()) {
   acl.setEntry(fromProto(tEntry));
  }
 }
 return acl;
}
origin: Alluxio/alluxio

    .setSubject(name).setActions(actions).build();
 ret.setEntry(entry);
    .setSubject(name).setActions(actions).build();
 ret.setEntry(entry);
 AclEntry entry = new AclEntry.Builder().setType(AclEntryType.MASK)
   .setActions(actions).build();
 ret.setEntry(entry);
AclEntry entry = new AclEntry.Builder().setType(AclEntryType.OTHER)
  .setActions(actions).build();
ret.setEntry(entry);
origin: Alluxio/alluxio

acl.setEntry(new AclEntry.Builder().setType(AclEntryType.OWNING_USER).setSubject(OWNING_USER)
  .addAction(AclAction.READ).addAction(AclAction.WRITE).addAction(AclAction.EXECUTE).build());
acl.setEntry(new AclEntry.Builder().setType(AclEntryType.OWNING_GROUP).setSubject(OWNING_GROUP)
  .addAction(AclAction.READ).addAction(AclAction.EXECUTE).build());
acl.setEntry(new AclEntry.Builder().setType(AclEntryType.OTHER).build());
acl.setEntry(new AclEntry.Builder().setType(AclEntryType.NAMED_USER).setSubject(NAMED_USER)
  .addAction(AclAction.READ).addAction(AclAction.WRITE).addAction(AclAction.EXECUTE).build());
acl.setEntry(new AclEntry.Builder().setType(AclEntryType.NAMED_GROUP).setSubject(NAMED_GROUP)
  .addAction(AclAction.WRITE).addAction(AclAction.EXECUTE).build());
acl.updateMask();
alluxio.security.authorizationAccessControlListsetEntry

Javadoc

Sets an entry into the access control list. If an entry with the same type and subject already exists, overwrites the existing entry; Otherwise, adds this new entry. After we modify entries for NAMED_GROUP, OWNING_GROUP, NAMED_USER, we need to update the mask.

Popular methods of AccessControlList

  • <init>
    Creates a new instance where owning user and owning group are initialized to empty strings, and no a
  • getEntries
    Returns a list of AclEntry which represent this ACL instance. The mask will only be included if exte
  • getOwningGroup
  • getOwningUser
  • hasExtended
  • setOwningGroup
    Sets owning group.
  • setOwningUser
    Sets owning user.
  • getMode
  • getPermission
    Gets the permitted actions for a user. When AccessControlList is not modified after calling getPermi
  • setMode
    Sets permitted actions for owning user, owning group, and other based on the mode. The format of mod
  • toString
  • toStringEntries
  • toString,
  • toStringEntries,
  • checkPermission,
  • clearEntries,
  • fromStringEntries,
  • getOtherActions,
  • getOwningGroupActions,
  • getOwningUserActions,
  • removeEntry

Popular in Java

  • Updating database using SQL prepared statement
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Path (java.nio.file)
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Notification (javax.management)
  • 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