Package org.jboss.security.mapping

Examples of org.jboss.security.mapping.MappingContext


       * and the subject roles are not the same
       */
      if(subjectRoles != userRoles || emptyContextRoles)
      {
         MappingManager mm = sc.getMappingManager();
         MappingContext mc = mm.getMappingContext(Group.class);
         Group mappedUserRoles = userRoles;
         if(mc != null)
         {
            Map contextMap = new HashMap();
            contextMap.put(SecurityConstants.ROLES_IDENTIFIER, userRoles);
            contextMap.put(SecurityConstants.PRINCIPAL_IDENTIFIER, principal);
            //Append any deployment role->principals configuration done by the user
            contextMap.put(SecurityConstants.DEPLOYMENT_PRINCIPAL_ROLES_MAP,
                  SecurityRolesAssociation.getSecurityRoles());
           
            //Append the principals also
            contextMap.put(SecurityConstants.PRINCIPALS_SET_IDENTIFIER, subject.getPrincipals());
            if(trace)
               log.trace("Roles before mapping:"+ userRoles);
            mc.performMapping(contextMap, userRoles);
            mappedUserRoles = (Group) mc.getMappingResult().getMappedObject();
            if(trace)
               log.trace("Roles after mapping:"+ userRoles);
         }
         sc.getData().put(ROLES_IDENTIFIER, mappedUserRoles);
      }
View Full Code Here


      }
      if(aPolicy == null )
         throw new IllegalStateException("Application Policy is null for the security domain:"
               + securityDomain);
      MappingInfo rmi = null;
      MappingContext mc = null;
      if(mappingType == Group.class)
      {
         rmi = aPolicy.getRoleMappingInfo();
         if(rmi != null)
         {
            MappingModuleEntry[] mpe = rmi.getMappingModuleEntry();
            ArrayList<MappingProvider> al = new ArrayList<MappingProvider>();
           
            for(int i = 0 ; i < mpe.length; i++)
            {
               MappingProvider mp = getMappingProvider(mpe[i]);
               if(mp != null)
                  al.add(mp);
            }
            mc = new MappingContext(al);
         }
      }
         return mc;
   }
View Full Code Here

      }
      if(aPolicy == null )
         throw new IllegalStateException("Application Policy is null for the security domain:"
               + securityDomain);
      MappingInfo rmi = null;
      MappingContext mc = null;
      if(mappingType == Group.class)
      {
         rmi = aPolicy.getRoleMappingInfo();         
      }
      else if(mappingType == Principal.class)
      {
         rmi = aPolicy.getPrincipalMappingInfo()
      }
     
      if(rmi != null)
      {
         MappingModuleEntry[] mpe = rmi.getMappingModuleEntry();
         ArrayList<MappingProvider> al = new ArrayList<MappingProvider>();
        
         for(int i = 0 ; i < mpe.length; i++)
         {
            MappingProvider mp = getMappingProvider(mpe[i]);
            if(mp != null)
               al.add(mp);
         }
         mc = new MappingContext(al);
      }
     
      return mc;
   }
View Full Code Here

       * allow mapping rules be applied only if the SC roles
       * and the subject roles are not the same
       */
      if(subjectRoles != userRoles || emptyContextRoles)
      {
         MappingContext mc = sc.getMappingManager().getMappingContext(Group.class);
         if(mc != null)
         {
            Map contextMap = new HashMap();
            contextMap.put(SecurityConstants.ROLES_IDENTIFIER, userRoles);
            contextMap.put(SecurityConstants.PRINCIPAL_IDENTIFIER, principal);
            //Append any deployment role->principals configuration done by the user
            contextMap.put(SecurityConstants.DEPLOYMENT_PRINCIPAL_ROLES_MAP,
                  SecurityRolesAssociation.getSecurityRoles());
           
            //Append the principals also
            contextMap.put(SecurityConstants.PRINCIPALS_SET_IDENTIFIER, subject.getPrincipals());
            if(trace)
               log.trace("Roles before mapping:"+ userRoles);
            mc.performMapping(contextMap, userRoles);
            if(trace)
               log.trace("Roles after mapping:"+ userRoles);
         }
         sc.getData().put(ROLES_IDENTIFIER, userRoles);
      }
View Full Code Here

       * and the subject roles are not the same
       */
      if(subjectRoles != userRoles || emptyContextRoles)
      {
         MappingManager mm = sc.getMappingManager();
         MappingContext mc = mm.getMappingContext(Group.class);
         Group mappedUserRoles = userRoles;
         if(mc != null)
         {
            Map contextMap = new HashMap();
            contextMap.put(SecurityConstants.ROLES_IDENTIFIER, userRoles);
            contextMap.put(SecurityConstants.PRINCIPAL_IDENTIFIER, principal);
            //Append any deployment role->principals configuration done by the user
            contextMap.put(SecurityConstants.DEPLOYMENT_PRINCIPAL_ROLES_MAP,
                  SecurityRolesAssociation.getSecurityRoles());
           
            //Append the principals also
            contextMap.put(SecurityConstants.PRINCIPALS_SET_IDENTIFIER, subject.getPrincipals());
            if(trace)
               log.trace("Roles before mapping:"+ userRoles);
            mc.performMapping(contextMap, userRoles);
            mappedUserRoles = (Group) mc.getMappingResult().getMappedObject();
            if(trace)
               log.trace("Roles after mapping:"+ userRoles);
         }
         sc.getData().put(ROLES_IDENTIFIER, mappedUserRoles);
      }
View Full Code Here

       * and the subject roles are not the same
       */
      if(subjectRoles != userRoles || emptyContextRoles)
      {
         MappingManager mm = sc.getMappingManager();
         MappingContext mc = mm.getMappingContext(Group.class);
         if(mc != null)
         {
            Map contextMap = new HashMap();
            contextMap.put(SecurityConstants.ROLES_IDENTIFIER, userRoles);
            contextMap.put(SecurityConstants.PRINCIPAL_IDENTIFIER, principal);
            //Append any deployment role->principals configuration done by the user
            contextMap.put(SecurityConstants.DEPLOYMENT_PRINCIPAL_ROLES_MAP,
                  SecurityRolesAssociation.getSecurityRoles());
           
            //Append the principals also
            contextMap.put(SecurityConstants.PRINCIPALS_SET_IDENTIFIER, subject.getPrincipals());
            if(trace)
               log.trace("Roles before mapping:"+ userRoles);
            mc.performMapping(contextMap, userRoles);
            if(trace)
               log.trace("Roles after mapping:"+ userRoles);
         }
         sc.getData().put(ROLES_IDENTIFIER, userRoles);
      }
View Full Code Here

      }
      if(aPolicy == null )
         throw new IllegalStateException("Application Policy is null for the security domain:"
               + securityDomain);
      MappingInfo rmi = null;
      MappingContext mc = null;
      if(mappingType == Group.class)
      {
         rmi = aPolicy.getRoleMappingInfo();
         if(rmi != null)
         {
            MappingModuleEntry[] mpe = rmi.getMappingModuleEntry();
            ArrayList<MappingProvider> al = new ArrayList<MappingProvider>();
           
            for(int i = 0 ; i < mpe.length; i++)
            {
               MappingProvider mp = getMappingProvider(mpe[i]);
               if(mp != null)
                  al.add(mp);
            }
            mc = new MappingContext(al);
         }
      }
         return mc;
   }
View Full Code Here

/* 347 */     userRoles = copyGroups(userRoles, subjectRoles);
/*     */
/* 354 */     if ((subjectRoles != userRoles) || (emptyContextRoles))
/*     */     {
/* 356 */       MappingManager mm = sc.getMappingManager();
/* 357 */       MappingContext mc = mm.getMappingContext(Group.class);
/* 358 */       Group mappedUserRoles = userRoles;
/* 359 */       if (mc != null)
/*     */       {
/* 361 */         Map contextMap = new HashMap();
/* 362 */         contextMap.put("Roles", userRoles);
/* 363 */         contextMap.put("Principal", principal);
/*     */
/* 365 */         contextMap.put("deploymentPrincipalRolesMap", SecurityRolesAssociation.getSecurityRoles());
/*     */
/* 369 */         contextMap.put("PrincipalsSet", subject.getPrincipals());
/* 370 */         if (this.trace)
/* 371 */           log.trace("Roles before mapping:" + userRoles);
/* 372 */         mc.performMapping(contextMap, userRoles);
/* 373 */         mappedUserRoles = (Group)mc.getMappingResult().getMappedObject();
/* 374 */         if (this.trace)
/* 375 */           log.trace("Roles after mapping:" + userRoles);
/*     */       }
/* 377 */       sc.getData().put("Roles", mappedUserRoles);
/*     */     }
View Full Code Here

/*     */     }
/*  76 */     if (aPolicy == null) {
/*  77 */       throw new IllegalStateException("Application Policy is null for the security domain:" + this.securityDomain);
/*     */     }
/*  79 */     MappingInfo rmi = null;
/*  80 */     MappingContext mc = null;
/*  81 */     if (mappingType == Group.class)
/*     */     {
/*  83 */       rmi = aPolicy.getRoleMappingInfo();
/*     */     }
/*  85 */     else if (mappingType == Principal.class)
/*     */     {
/*  87 */       rmi = aPolicy.getPrincipalMappingInfo();
/*     */     }
/*     */
/*  90 */     if (rmi != null)
/*     */     {
/*  92 */       MappingModuleEntry[] mpe = rmi.getMappingModuleEntry();
/*  93 */       ArrayList al = new ArrayList();
/*     */
/*  95 */       for (int i = 0; i < mpe.length; i++)
/*     */       {
/*  97 */         MappingProvider mp = getMappingProvider(mpe[i]);
/*  98 */         if (mp != null)
/*  99 */           al.add(mp);
/*     */       }
/* 101 */       mc = new MappingContext(al);
/*     */     }
/*     */
/* 104 */     return mc;
/*     */   }
View Full Code Here

      }
      if(aPolicy == null )
         throw new IllegalStateException("Application Policy is null for the security domain:"
               + securityDomain);
      MappingInfo rmi = null;
      MappingContext mc = null;
      if(mappingType == Group.class)
      {
         rmi = aPolicy.getRoleMappingInfo();
         if(rmi != null)
         {
            MappingModuleEntry[] mpe = rmi.getMappingModuleEntry();
            ArrayList<MappingProvider> al = new ArrayList<MappingProvider>();
           
            for(int i = 0 ; i < mpe.length; i++)
            {
               MappingProvider mp = getMappingProvider(mpe[i]);
               if(mp != null)
                  al.add(mp);
            }
            mc = new MappingContext(al);
         }
      }
         return mc;
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.mapping.MappingContext

Copyright © 2018 www.massapicom. 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.