congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SentryStoreLayer.getPrivilegesByProvider
Code IndexAdd Tabnine to your IDE (free)

How to use
getPrivilegesByProvider
method
in
org.apache.sentry.provider.db.generic.service.persistent.SentryStoreLayer

Best Java code snippets using org.apache.sentry.provider.db.generic.service.persistent.SentryStoreLayer.getPrivilegesByProvider (Showing top 6 results out of 315)

origin: apache/sentry

 @Override
 public Response<Set<TSentryPrivilege>> handle() throws Exception {
  validateClientVersion(request.getProtocol_version());
  Set<String> groups = getRequestorGroups(conf, request.getRequestorUserName());
  if (!inAdminGroups(groups)) {
   Set<String> roleNamesForGroups = toTrimmedLower(store.getRolesByGroups(request.getComponent(), groups));
   if (!roleNamesForGroups.contains(toTrimmedLower(request.getRoleName()))) {
    throw new SentryAccessDeniedException(ACCESS_DENIAL_MESSAGE + request.getRequestorUserName());
   }
  }
  Set<PrivilegeObject> privileges = store.getPrivilegesByProvider(request.getComponent(),
                                  request.getServiceName(),
                                  Sets.newHashSet(request.getRoleName()),
                                  null, toAuthorizables(request.getAuthorizables()));
  Set<TSentryPrivilege> tSentryPrivileges = Sets.newHashSet();
  for (PrivilegeObject privilege : privileges) {
   tSentryPrivileges.add(fromPrivilegeObject(privilege));
  }
  return new Response<Set<TSentryPrivilege>>(Status.OK(), tSentryPrivileges);
 }
});
origin: apache/incubator-sentry

 @Override
 public Response<Set<TSentryPrivilege>> handle() throws Exception {
  validateClientVersion(request.getProtocol_version());
  Set<String> groups = getRequestorGroups(conf, request.getRequestorUserName());
  if (!inAdminGroups(groups)) {
   Set<String> roleNamesForGroups = toTrimmedLower(store.getRolesByGroups(request.getComponent(), groups));
   if (!roleNamesForGroups.contains(toTrimmedLower(request.getRoleName()))) {
    throw new SentryAccessDeniedException(ACCESS_DENIAL_MESSAGE + request.getRequestorUserName());
   }
  }
  Set<PrivilegeObject> privileges = store.getPrivilegesByProvider(request.getComponent(),
                                  request.getServiceName(),
                                  Sets.newHashSet(request.getRoleName()),
                                  null, toAuthorizables(request.getAuthorizables()));
  Set<TSentryPrivilege> tSentryPrivileges = Sets.newHashSet();
  for (PrivilegeObject privilege : privileges) {
   tSentryPrivileges.add(fromPrivilegeObject(privilege));
  }
  return new Response<Set<TSentryPrivilege>>(Status.OK(), tSentryPrivileges);
 }
});
origin: apache/incubator-sentry

 @Override
 public Response<Set<String>> handle() throws Exception {
  validateClientVersion(request.getProtocol_version());
  Set<String> activeRoleNames = toTrimmedLower(request.getRoleSet().getRoles());
  Set<String> roleNamesForGroups = store.getRolesByGroups(request.getComponent(), request.getGroups());
  Set<String> rolesToQuery = request.getRoleSet().isAll() ? roleNamesForGroups : Sets.intersection(activeRoleNames, roleNamesForGroups);
  Set<PrivilegeObject> privileges = store.getPrivilegesByProvider(request.getComponent(),
                                  request.getServiceName(),
                                  rolesToQuery, null,
                                  toAuthorizables(request.getAuthorizables()));
  return new Response<Set<String>>(Status.OK(), buildPermissions(privileges));
 }
});
origin: apache/sentry

 @Override
 public Response<Set<String>> handle() throws Exception {
  validateClientVersion(request.getProtocol_version());
  Set<String> activeRoleNames = toTrimmedLower(request.getRoleSet().getRoles());
  Set<String> roleNamesForGroups = store.getRolesByGroups(request.getComponent(), request.getGroups());
  Set<String> rolesToQuery = request.getRoleSet().isAll() ? roleNamesForGroups : Sets.intersection(activeRoleNames, roleNamesForGroups);
  Set<PrivilegeObject> privileges = store.getPrivilegesByProvider(request.getComponent(),
                                  request.getServiceName(),
                                  rolesToQuery, null,
                                  toAuthorizables(request.getAuthorizables()));
  return new Response<Set<String>>(Status.OK(), buildPermissions(privileges));
 }
});
origin: apache/incubator-sentry

.thenReturn(Sets.newHashSet(roleName));
Mockito.when(mockStore.getPrivilegesByProvider(anyString(), anyString(), anySetOf(String.class),
  anySetOf(String.class), anyListOf(Authorizable.class)))
.thenReturn(Sets.newHashSet(queryPrivilege, updatePrivilege));
origin: apache/sentry

.thenReturn(Sets.newHashSet(roleName));
Mockito.when(mockStore.getPrivilegesByProvider(anyString(), anyString(), anySetOf(String.class),
  anySetOf(String.class), anyListOf(Authorizable.class)))
.thenReturn(Sets.newHashSet(queryPrivilege, updatePrivilege));
org.apache.sentry.provider.db.generic.service.persistentSentryStoreLayergetPrivilegesByProvider

Javadoc

get sentry privileges from provider as followings:

Popular methods of SentryStoreLayer

  • alterRoleAddGroups
    Add a role to groups.
  • alterRoleDeleteGroups
    Delete a role from groups.
  • alterRoleGrantPrivilege
    Grant a privilege to role.
  • alterRoleRevokePrivilege
    Revoke a privilege from role.
  • createRole
    Create a role
  • dropPrivilege
    Drop privilege
  • dropRole
    Drop a role
  • getAllRoleNames
    Get all roles name.
  • getPrivilegesByAuthorizable
    Get sentry privileges based on valid active roles and the authorize objects.
  • getRolesByGroups
    Get roles
  • renamePrivilege
    Rename privilege
  • getGroupsByRoles
    Get groups
  • renamePrivilege,
  • getGroupsByRoles,
  • getPrivilegesByRole,
  • getTSentryRolesByGroupName

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • getApplicationContext (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Menu (java.awt)
  • Path (java.nio.file)
  • JTextField (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top 12 Jupyter Notebook extensions
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