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

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

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

origin: Alluxio/alluxio

 /**
  * Deserialize an AccessControlList object.
  * @param jsonParser the json parser
  * @param deserializationContext deserializationcontext
  * @return
  * @throws IOException
  * @throws JsonProcessingException
  */
 @Override
 public AccessControlList deserialize(JsonParser jsonParser,
   DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
  JsonNode node = jsonParser.getCodec().readTree(jsonParser);
  String owner = node.get(OWNER_FIELD).asText();
  String owningGroup = node.get(OWNING_GROUP_FIELD).asText();
  List<String> stringEntries = new ArrayList<>();
  Iterator<JsonNode> nodeIterator = node.get(STRING_ENTRY_FIELD).elements();
  while (nodeIterator.hasNext()) {
   stringEntries.add(nodeIterator.next().asText());
  }
  return AccessControlList.fromStringEntries(owner, owningGroup, stringEntries);
 }
}
origin: Alluxio/alluxio

List<String> stringEntries = Arrays.asList("user::rw-", "group::r--", "other::rwx");
AccessControlList acl =
  AccessControlList.fromStringEntries(userName, groupName, stringEntries);
result.setAcl(acl);
List<String> defaultStringEntries =
  Arrays.asList("default:user::rw-", "default:group::r--", "default:other::rwx");
result.setDefaultAcl((DefaultAccessControlList) AccessControlList
  .fromStringEntries(userName, groupName, defaultStringEntries));
return result;
origin: Alluxio/alluxio

 @Test
 public void createACLFingeprint() {
  UfsStatus status = new UfsFileStatus(CommonUtils.randomAlphaNumString(10),
    CommonUtils.randomAlphaNumString(10), mRandom.nextLong(), mRandom.nextLong(),
    CommonUtils.randomAlphaNumString(10), CommonUtils.randomAlphaNumString(10),
    (short) mRandom.nextInt());
  AccessControlList acl = AccessControlList.fromStringEntries(
    CommonUtils.randomAlphaNumString(10),
    CommonUtils.randomAlphaNumString(10),
    Arrays.asList("user::rw-", "group::r--", "other::rwx"));
  Fingerprint fp = Fingerprint.create(CommonUtils.randomAlphaNumString(10), status, acl);
  String expected = fp.serialize();
  Assert.assertNotNull(expected);
  Assert.assertEquals("user::rw-,group::r--,other::rwx",
    Fingerprint.parse(expected).getTag(Fingerprint.Tag.ACL));
  Assert.assertEquals(expected, Fingerprint.parse(expected).serialize());
 }
}
alluxio.security.authorizationAccessControlListfromStringEntries

Javadoc

Converts a list of string entries into an AccessControlList or a DefaultAccessControlList. It assumes the stringEntries contain all default entries or normal entries.

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
  • setEntry
    Sets an entry into the access control list. If an entry with the same type and subject already exist
  • 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
  • setMode,
  • toString,
  • toStringEntries,
  • checkPermission,
  • clearEntries,
  • 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)
  • Github Copilot alternatives
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