Examples of principalRoleMapper()


Examples of org.infinispan.configuration.global.GlobalAuthorizationConfiguration.principalRoleMapper()

   public Result execute(Session session) throws StatementException {
      GlobalAuthorizationConfiguration gac = session.getCacheManager().getCacheManagerConfiguration().security().authorization();
      if (!gac.enabled()) {
         throw log.authorizationNotEnabledOnContainer();
      }
      if (!(gac.principalRoleMapper() instanceof ClusterRoleMapper)) {
         throw log.noClusterPrincipalMapper("DENY");
      }
      ClusterRoleMapper cpm = (ClusterRoleMapper) gac.principalRoleMapper();
      cpm.deny(roleName, principalName);
      return EmptyResult.RESULT;
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalAuthorizationConfiguration.principalRoleMapper()

         throw log.authorizationNotEnabledOnContainer();
      }
      if (!(gac.principalRoleMapper() instanceof ClusterRoleMapper)) {
         throw log.noClusterPrincipalMapper("DENY");
      }
      ClusterRoleMapper cpm = (ClusterRoleMapper) gac.principalRoleMapper();
      cpm.deny(roleName, principalName);
      return EmptyResult.RESULT;
   }

}
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalAuthorizationConfiguration.principalRoleMapper()

   public Result execute(Session session) throws StatementException {
      GlobalAuthorizationConfiguration gac = session.getCacheManager().getCacheManagerConfiguration().security().authorization();
      if (!gac.enabled()) {
         throw log.authorizationNotEnabledOnContainer();
      }
      if (!(gac.principalRoleMapper() instanceof ClusterRoleMapper)) {
         throw log.noClusterPrincipalMapper("ROLES");
      }
      ClusterRoleMapper cpm = (ClusterRoleMapper) gac.principalRoleMapper();
      if (principalName != null) {
         return new StringResult(cpm.list(principalName).toString());
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalAuthorizationConfiguration.principalRoleMapper()

         throw log.authorizationNotEnabledOnContainer();
      }
      if (!(gac.principalRoleMapper() instanceof ClusterRoleMapper)) {
         throw log.noClusterPrincipalMapper("ROLES");
      }
      ClusterRoleMapper cpm = (ClusterRoleMapper) gac.principalRoleMapper();
      if (principalName != null) {
         return new StringResult(cpm.list(principalName).toString());
      } else {
         return new StringResult(cpm.listAll());
      }
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalAuthorizationConfiguration.principalRoleMapper()

   public Result execute(Session session) throws StatementException {
      GlobalAuthorizationConfiguration gac = session.getCacheManager().getCacheManagerConfiguration().security().authorization();
      if (!gac.enabled()) {
         throw log.authorizationNotEnabledOnContainer();
      }
      if (!(gac.principalRoleMapper() instanceof ClusterRoleMapper)) {
         throw log.noClusterPrincipalMapper("GRANT");
      }
      ClusterRoleMapper cpm = (ClusterRoleMapper) gac.principalRoleMapper();
      cpm.grant(roleName, principalName);
      return EmptyResult.RESULT;
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalAuthorizationConfiguration.principalRoleMapper()

         throw log.authorizationNotEnabledOnContainer();
      }
      if (!(gac.principalRoleMapper() instanceof ClusterRoleMapper)) {
         throw log.noClusterPrincipalMapper("GRANT");
      }
      ClusterRoleMapper cpm = (ClusterRoleMapper) gac.principalRoleMapper();
      cpm.grant(roleName, principalName);
      return EmptyResult.RESULT;
   }

}
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalAuthorizationConfigurationBuilder.principalRoleMapper()

               throw ParseUtils.unexpectedElement(reader);
            }
         }
      }
      if (roleMapper != null) {
         builder.principalRoleMapper(roleMapper);
      }
   }

   private PrincipalRoleMapper parseCustomMapper(XMLExtendedStreamReader reader, ConfigurationBuilderHolder holder) throws XMLStreamException {
      String mapperClass = ParseUtils.requireSingleAttribute(reader, Attribute.CLASS.getLocalName());
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalAuthorizationConfigurationBuilder.principalRoleMapper()

        if (authorization != null) {
            authorizationBuilder.enable();
            if (authorization.getPrincipalMapper() != null) {
                try {
                    authorizationBuilder.principalRoleMapper(Class.forName(authorization.getPrincipalMapper(), true, loader).asSubclass(PrincipalRoleMapper.class).newInstance());
                } catch (Exception e) {
                    throw new StartException(e);
                }
            } else {
                authorizationBuilder.principalRoleMapper(new ServerPrincipalMapper());
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalAuthorizationConfigurationBuilder.principalRoleMapper()

                    authorizationBuilder.principalRoleMapper(Class.forName(authorization.getPrincipalMapper(), true, loader).asSubclass(PrincipalRoleMapper.class).newInstance());
                } catch (Exception e) {
                    throw new StartException(e);
                }
            } else {
                authorizationBuilder.principalRoleMapper(new ServerPrincipalMapper());
            }
            for(Entry<String, List<String>> role : authorization.getRoles().entrySet()) {
                GlobalRoleConfigurationBuilder roleBuilder = authorizationBuilder.role(role.getKey());
                for(String perm : role.getValue()) {
                    roleBuilder.permission(perm);
View Full Code Here

Examples of org.infinispan.configuration.global.GlobalAuthorizationConfigurationBuilder.principalRoleMapper()

            case ENABLED: {
               builder.enabled(Boolean.parseBoolean(value));
               break;
            }
            case MAPPER: {
               builder.principalRoleMapper(Util.<PrincipalRoleMapper>getInstance(value, holder.getClassLoader()));
               break;
            }
            default: {
               throw ParseUtils.unexpectedAttribute(reader, i);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.