コード例 #1
0
 private Iterable<Privilege> getPrivileges(
     Set<String> groups, ActiveRoleSet roleSet, Authorizable[] authorizables) {
   return Iterables.transform(
       appendDefaultDBPriv(policy.getPrivileges(groups, roleSet, authorizables), authorizables),
       new Function<String, Privilege>() {
         @Override
         public Privilege apply(String privilege) {
           return privilegeFactory.createPrivilege(privilege);
         }
       });
 }
コード例 #2
0
 public ResourceAuthorizationProvider(PolicyEngine policy, GroupMappingService groupService) {
   this.policy = policy;
   this.groupService = groupService;
   this.privilegeFactory = policy.getPrivilegeFactory();
   this.lastFailedPrivileges =
       new ThreadLocal<List<String>>() {
         @Override
         protected List<String> initialValue() {
           return new ArrayList<String>();
         }
       };
 }
コード例 #3
0
 @Override
 public void close() {
   if (policy != null) {
     policy.close();
   }
 }
コード例 #4
0
 @Override
 public Set<String> listPrivilegesForGroup(String groupName) throws SentryConfigurationException {
   return policy.getPrivileges(Sets.newHashSet(groupName), ActiveRoleSet.ALL, null);
 }
コード例 #5
0
 @Override
 public Set<String> listPrivilegesForSubject(Subject subject) throws SentryConfigurationException {
   return policy.getPrivileges(getGroups(subject), ActiveRoleSet.ALL, null);
 }
コード例 #6
0
 @Override
 public void validateResource(boolean strictValidation) throws SentryConfigurationException {
   policy.validatePolicy(strictValidation);
 }