congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
SentryStoreLayer.getGroupsByRoles
Code IndexAdd Tabnine to your IDE (free)

How to use
getGroupsByRoles
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.getGroupsByRoles (Showing top 3 results out of 315)

origin: apache/incubator-sentry

 @Override
 public Response<Set<TSentryRole>> handle() throws Exception {
  validateClientVersion(request.getProtocol_version());
  Set<String> groups = getRequestorGroups(conf, request.getRequestorUserName());
  if (!AccessConstants.ALL.equalsIgnoreCase(request.getGroupName())) {
   boolean admin = inAdminGroups(groups);
   //Only admin users can list all roles in the system ( groupname = null)
   //Non admin users are only allowed to list only groups which they belong to
   if(!admin && (request.getGroupName() == null || !groups.contains(request.getGroupName()))) {
    throw new SentryAccessDeniedException(ACCESS_DENIAL_MESSAGE + request.getRequestorUserName());
   }
   groups.clear();
   groups.add(request.getGroupName());
  }
  Set<String> roleNames = store.getRolesByGroups(request.getComponent(), groups);
  Set<TSentryRole> tSentryRoles = Sets.newHashSet();
  for (String roleName : roleNames) {
   Set<String> groupsForRoleName = store.getGroupsByRoles(request.getComponent(), Sets.newHashSet(roleName));
   tSentryRoles.add(new TSentryRole(roleName, groupsForRoleName));
  }
  return new Response<Set<TSentryRole>>(Status.OK(), tSentryRoles);
 }
});
origin: apache/sentry

.thenReturn(Sets.newHashSet(queryPrivilege, updatePrivilege));
Mockito.when(mockStore.getGroupsByRoles(anyString(), anySetOf(String.class)))
.thenReturn(Sets.newHashSet(groupName));
origin: apache/incubator-sentry

.thenReturn(Sets.newHashSet(queryPrivilege, updatePrivilege));
Mockito.when(mockStore.getGroupsByRoles(anyString(), anySetOf(String.class)))
.thenReturn(Sets.newHashSet(groupName));
org.apache.sentry.provider.db.generic.service.persistentSentryStoreLayergetGroupsByRoles

Javadoc

Get groups

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.
  • getPrivilegesByProvider
    get sentry privileges from provider as followings:
  • getRolesByGroups
    Get roles
  • renamePrivilege
    Rename privilege
  • getRolesByGroups,
  • renamePrivilege,
  • getPrivilegesByRole,
  • getTSentryRolesByGroupName

Popular in Java

  • Reactive rest calls using spring rest template
  • getContentResolver (Context)
  • getSystemService (Context)
  • getExternalFilesDir (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now