public Object getFieldValue(_Fields field) { switch (field) { case ALL: return isAll(); case ROLES: return getRoles(); } throw new IllegalStateException(); }
private Set<String> getRolesToQuery(final Set<String> groups, final Set<String> users, final TSentryActiveRoleSet roleSet) throws Exception { return tm.executeTransaction( pm -> { pm.setDetachAllOnCommit(false); // No need to detach objects Set<String> activeRoleNames = toTrimedLower(roleSet.getRoles()); Set<String> roleNames = Sets.newHashSet(); roleNames.addAll(toTrimedLower(getRoleNamesForGroupsCore(pm, groups))); roleNames.addAll(toTrimedLower(getRoleNamesForUsersCore(pm, users))); return roleSet.isAll() ? roleNames : Sets.intersection(activeRoleNames, roleNames); }); }
for (String aRole : activeRoles.getRoles()) { roles.add(aRole.toLowerCase());
Set<String> roles = toTrimedLower(sentryStore .getRoleNamesForGroups(memberGroups)); for (String role : toTrimedLower(requestedRoleSet.getRoles())) { if (!roles.contains(role)) { throw new SentryAccessDeniedException("Access denied to "