Tabnine Logo
PrivilegeFactory.createPrivilege
Code IndexAdd Tabnine to your IDE (free)

How to use
createPrivilege
method
in
org.apache.sentry.policy.common.PrivilegeFactory

Best Java code snippets using org.apache.sentry.policy.common.PrivilegeFactory.createPrivilege (Showing top 2 results out of 315)

origin: apache/incubator-sentry

 @Override
 public Privilege apply(String privilege) {
  return privilegeFactory.createPrivilege(privilege);
 }
});
origin: apache/incubator-sentry

private boolean doHasAccess(Subject subject,
  List<? extends Authorizable> authorizables, Set<? extends Action> actions,
  ActiveRoleSet roleSet) {
 Set<String> groups =  getGroups(subject);
 Set<String> hierarchy = new HashSet<String>();
 for (Authorizable authorizable : authorizables) {
  hierarchy.add(KV_JOINER.join(authorizable.getTypeName(), authorizable.getName()));
 }
 List<String> requestPrivileges = buildPermissions(authorizables, actions);
 Iterable<Privilege> privileges = getPrivileges(groups, roleSet, authorizables.toArray(new Authorizable[0]));
 lastFailedPrivileges.get().clear();
 for (String requestPrivilege : requestPrivileges) {
  for (Privilege permission : privileges) {
   /*
    * Does the permission granted in the policy file imply the requested action?
    */
   boolean result = permission.implies(privilegeFactory.createPrivilege(requestPrivilege));
   if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("ProviderPrivilege {}, RequestPrivilege {}, RoleSet, {}, Result {}",
      new Object[]{ permission, requestPrivilege, roleSet, result});
   }
   if (result) {
    return true;
   }
  }
 }
 lastFailedPrivileges.get().addAll(requestPrivileges);
 return false;
}
org.apache.sentry.policy.commonPrivilegeFactorycreatePrivilege

Popular methods of PrivilegeFactory

    Popular in Java

    • Parsing JSON documents to java classes using gson
    • runOnUiThread (Activity)
    • onRequestPermissionsResult (Fragment)
    • getOriginalFilename (MultipartFile)
      Return the original filename in the client's filesystem.This may contain path information depending
    • VirtualMachine (com.sun.tools.attach)
      A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
    • ServerSocket (java.net)
      This class represents a server-side socket that waits for incoming client connections. A ServerSocke
    • URLConnection (java.net)
      A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
    • List (java.util)
      An ordered collection (also known as a sequence). The user of this interface has precise control ove
    • Executor (java.util.concurrent)
      An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
    • HttpServletRequest (javax.servlet.http)
      Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
    • 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