Tabnine Logo
MSentryRole.getUsers
Code IndexAdd Tabnine to your IDE (free)

How to use
getUsers
method
in
org.apache.sentry.provider.db.service.model.MSentryRole

Best Java code snippets using org.apache.sentry.provider.db.service.model.MSentryRole.getUsers (Showing top 2 results out of 315)

origin: apache/sentry

private Map<String, Set<String>> getUserRolesMap(Collection<MSentryRole> mSentryRoles) {
 if (mSentryRoles.isEmpty()) {
  return Collections.emptyMap();
 }
 Map<String, Set<String>> userRolesMap = new HashMap<>();
 // change the List<MSentryRole> -> Map<userName, Set<roleName>>
 for (MSentryRole mSentryRole : mSentryRoles) {
  Set<MSentryUser> users = mSentryRole.getUsers();
  for (MSentryUser user : users) {
   String userName = user.getUserName();
   Set<String> rNames = userRolesMap.get(userName);
   if (rNames == null) {
    rNames = new HashSet<>();
   }
   rNames.add(mSentryRole.getRoleName());
   userRolesMap.put(userName, rNames);
  }
 }
 return userRolesMap;
}
origin: apache/sentry

@Test
public void testAddDeleteUsers() throws Exception {
 String roleName = "test-users";
 createRole(roleName);
 Set<String> users = Sets.newHashSet("test-user-u1", "test-user-u2");
 sentryStore.alterSentryRoleAddUsers(roleName, users);
 MSentryRole role = sentryStore.getMSentryRoleByName(roleName);
 role.getUsers().size();
 sentryStore.alterSentryRoleDeleteUsers(roleName, users);
 role = sentryStore.getMSentryRoleByName(roleName);
 assertEquals(0, role.getUsers().size());
}
org.apache.sentry.provider.db.service.modelMSentryRolegetUsers

Popular methods of MSentryRole

  • <init>
  • getGmPrivileges
  • getGroups
  • getPrivileges
  • removeGMPrivileges
  • removePrivileges
  • getRoleName
  • appendGMPrivilege
  • appendGroup
  • removeGMPrivilege
  • removeGroup
  • appendPrivilege
  • removeGroup,
  • appendPrivilege,
  • appendUser,
  • removePrivilege,
  • removeUser

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JList (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • CodeWhisperer 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