Package org.jboss.seam.security

Examples of org.jboss.seam.security.Role


        
         List<Permission> permissions = new ArrayList<Permission>();
  
         for (String role : selectedRoles)
         {
            Principal r = new Role(role);
            for (String action : selectedActions)
            {           
               permissions.add(new Permission(target, action, r));
            }
         }
View Full Code Here


     
      if (ids instanceof JpaIdentityStore) identityStore = (JpaIdentityStore) ids;
     
      if (principal instanceof String)
      {       
         return isUser ? new SimplePrincipal((String) principal) : new Role((String) principal,
               identityStore == null ? false : identityStore.isRoleConditional((String) principal));
      }     
     
      if (identityStore != null)
      {
         if (isUser && identityStore.getUserClass().equals(principal.getClass()))
         {
            return new SimplePrincipal(identityStore.getUserName(principal));
         }
        
         if (!isUser && identityStore.getRoleClass().equals(principal.getClass()))
         {
            String name = identityStore.getRoleName(principal);
            return new Role(name, identityStore.isRoleConditional(name));
         }
      }
     
      throw new IllegalArgumentException("Cannot resolve principal name for principal " + principal);
   }
View Full Code Here

         members.add(new SimplePrincipal(user));
      }
     
      for (String roleName : listRoleMembers(role))
      {
         members.add(new Role(roleName));
      }
     
      return members;
   }
View Full Code Here

  
                  boolean found = false;
                  Iterator<Role> iter = getSecurityContext().iterateObjects(new ClassObjectFilter(Role.class));
                  while (iter.hasNext())
                  {
                     Role r = iter.next();
                     if (r.getName().equals(role.getName()))
                     {
                        found = true;
                        break;
                     }
                  }
                 
                  if (!found)
                  {
                     getSecurityContext().insert(new Role(role.getName()));
                  }
                 
               }
            }
         }   
        
         Iterator<Role> iter = getSecurityContext().iterateObjects(new ClassObjectFilter(Role.class));
         while (iter.hasNext())
         {
            Role r = iter.next();
            if (!identity.hasRole(r.getName()))
            {
               FactHandle fh = getSecurityContext().getFactHandle(r);
               getSecurityContext().retract(fh);
            }
         }
View Full Code Here

  
                  boolean found = false;
                  Iterator<Role> iter = getSecurityContext().iterateObjects(new ClassObjectFilter(Role.class));
                  while (iter.hasNext())
                  {
                     Role r = iter.next();
                     if (r.getName().equals(role.getName()))
                     {
                        found = true;
                        break;
                     }
                  }
                 
                  if (!found)
                  {
                     getSecurityContext().insert(new Role(role.getName()));
                  }
                 
               }
            }
         }   
        
         Iterator<Role> iter = getSecurityContext().iterateObjects(new ClassObjectFilter(Role.class));
         while (iter.hasNext())
         {
            Role r = iter.next();
            if (!identity.hasRole(r.getName()))
            {
               FactHandle fh = getSecurityContext().getFactHandle(r);
               getSecurityContext().retract(fh);
            }
         }
View Full Code Here

     
      if (ids instanceof JpaIdentityStore) identityStore = (JpaIdentityStore) ids;
     
      if (principal instanceof String)
      {       
         return isUser ? new SimplePrincipal((String) principal) : new Role((String) principal,
               identityStore == null ? false : identityStore.isRoleConditional((String) principal));
      }     
     
      if (identityStore != null)
      {
         if (isUser && identityStore.getUserClass().equals(principal.getClass()))
         {
            return new SimplePrincipal(identityStore.getUserName(principal));
         }
        
         if (!isUser && identityStore.getRoleClass().equals(principal.getClass()))
         {
            String name = identityStore.getRoleName(principal);
            return new Role(name, identityStore.isRoleConditional(name));
         }
      }
     
      throw new IllegalArgumentException("Cannot resolve principal name for principal " + principal);
   }
View Full Code Here

         members.add(new SimplePrincipal(user));
      }
     
      for (String roleName : listRoleMembers(role))
      {
         members.add(new Role(roleName));
      }
     
      return members;
   }
View Full Code Here

         members.add(new SimplePrincipal(user));
      }
     
      for (String roleName : listRoleMembers(role))
      {
         members.add(new Role(roleName));
      }
     
      return members;
   }
View Full Code Here

  
                  boolean found = false;
                  Iterator<Role> iter = (Iterator<Role>) getSecurityContext().iterateObjects(new ClassObjectFilter(Role.class));
                  while (iter.hasNext())
                  {
                     Role r = iter.next();
                     if (r.getName().equals(role.getName()))
                     {
                        found = true;
                        break;
                     }
                  }
                 
                  if (!found)
                  {
                     getSecurityContext().insert(new Role(role.getName()));
                  }
                 
               }
            }
         }   
        
         Iterator<Role> iter = (Iterator<Role>) getSecurityContext().iterateObjects(new ClassObjectFilter(Role.class));
         while (iter.hasNext())
         {
            Role r = iter.next();
            if (!identity.hasRole(r.getName()))
            {
               FactHandle fh = getSecurityContext().getFactHandle(r);
               getSecurityContext().retract(fh);
            }
         }
View Full Code Here

     
      if (ids instanceof JpaIdentityStore) identityStore = (JpaIdentityStore) ids;
     
      if (principal instanceof String)
      {       
         return isUser ? new SimplePrincipal((String) principal) : new Role((String) principal,
               identityStore == null ? false : identityStore.isRoleConditional((String) principal));
      }     
     
      if (identityStore != null)
      {
         if (isUser && identityStore.getUserClass().isAssignableFrom(principal.getClass()))
         {
            return new SimplePrincipal(identityStore.getUserName(principal));
         }
        
         if (!isUser && identityStore.getRoleClass().isAssignableFrom(principal.getClass()))
         {
            String name = identityStore.getRoleName(principal);
            return new Role(name, identityStore.isRoleConditional(name));
         }
      }
     
      throw new IllegalArgumentException("Cannot resolve principal name for principal " + principal);
   }
View Full Code Here

TOP

Related Classes of org.jboss.seam.security.Role

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.