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

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

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

origin: Alluxio/alluxio

@Override
public AclActions getPermission(String user, List<String> groups) {
 return mAcl.getPermission(user, groups);
}
origin: Alluxio/alluxio

/**
 * Checks whether the user has the permission to perform the action.
 *
 * 1. If the user is the owner, then the owner entry determines the permission;
 * 2. Else if the user matches the name of one of the named user entries, this entry determines
 *    the permission;
 * 3. Else if one of the groups is the owning group and the owning group entry contains the
 *    requested permission, the permission is granted;
 * 4. Else if one of the groups matches the name of one of the named group entries and this entry
 *    contains the requested permission, the permission is granted;
 * 5. Else if one of the groups is the owning group or matches the name of one of the named group
 *    entries, but neither the owning group entry nor any of the matching named group entries
 *    contains the requested permission, the permission is denied;
 * 6. Otherwise, the other entry determines the permission.
 *
 * @param user the user
 * @param groups the groups the user belongs to
 * @param action the action
 * @return whether user has the permission to perform the action
 */
public boolean checkPermission(String user, List<String> groups, AclAction action) {
 return getPermission(user, groups).contains(action);
}
origin: Alluxio/alluxio

private void assertMode(Mode.Bits expected, AccessControlList acl, String user,
  List<String> groups) {
 Assert.assertEquals(expected, acl.getPermission(user, groups).toModeBits());
}
alluxio.security.authorizationAccessControlListgetPermission

Javadoc

Gets the permitted actions for a user. When AccessControlList is not modified after calling getPermission, for each action returned by this method, checkPermission(user, groups, action) is true, for other actions, checkPermission(user, groups, action) is false. 1. If the user is the owner, then return the permission in the owner entry; 2. Else if the user matches the name of one of the named user entries, then return the AND result of the permission in this entry and the mask ; 3. Else if at least one of the groups is the owning group or matches the name of one of the named group entries, then for the named group entries that match a member of groups, merge the permissions in these entries and return the merged permission ANDed with the mask; 4. Otherwise, return the permission in the other entry.

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
  • 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

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • requestLocationUpdates (LocationManager)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Socket (java.net)
    Provides a client-side TCP socket.
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • 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