Package org.jboss.seam.security

Examples of org.jboss.seam.security.SimplePrincipal


      Identity identity = new Identity() {

         @Override
         public Principal getPrincipal()
         {
            return new SimplePrincipal(SEAM_USER);
         }

         @Override
         public boolean hasRole(String role)
         {
View Full Code Here


            MemberAccount acct = (MemberAccount) entityManager.createQuery(
                  "select a from MemberAccount a where a.member = :member")
                  .setParameter("member", friend)
                  .getSingleResult();
           
            Principal p = new SimplePrincipal(acct.getUsername());
           
            for (String action : selectedActions)
            {
               permissions.add(new Permission(target, action, p));
            }
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);
View Full Code Here

   {
      List<Principal> members = new ArrayList<Principal>();
     
      for (String user : listUserMembers(role))
      {
         members.add(new SimplePrincipal(user));
      }
     
      for (String roleName : listRoleMembers(role))
      {
         members.add(new Role(roleName));
View Full Code Here

      return true;
   }

   public boolean commit() throws LoginException
   {       
      subject.getPrincipals().add(new SimplePrincipal(username));
     
      Group roleGroup = null;
     
      for ( Group g : subject.getPrincipals(Group.class) )     
      {
         if ( ROLES_GROUP.equalsIgnoreCase( g.getName() ) )
         {
            roleGroup = g;
            break;
         }
      }

      if (roleGroup == null) roleGroup = new SimpleGroup(ROLES_GROUP);

      for (String role : roles)
      {
         roleGroup.addMember(new SimplePrincipal(role));
      }
     
      subject.getPrincipals().add(roleGroup);
     
      return true;
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);
View Full Code Here

   {
      List<Principal> members = new ArrayList<Principal>();
     
      for (String user : listUserMembers(role))
      {
         members.add(new SimplePrincipal(user));
      }
     
      for (String roleName : listRoleMembers(role))
      {
         members.add(new Role(roleName));
View Full Code Here

   {
      List<Principal> members = new ArrayList<Principal>();
     
      for (String user : listUserMembers(role))
      {
         members.add(new SimplePrincipal(user));
      }
     
      for (String roleName : listRoleMembers(role))
      {
         members.add(new Role(roleName));
View Full Code Here

      return true;
   }

   public boolean commit() throws LoginException
   {       
      subject.getPrincipals().add(new SimplePrincipal(username));
     
      Group roleGroup = null;
     
      for ( Group g : subject.getPrincipals(Group.class) )     
      {
         if ( ROLES_GROUP.equalsIgnoreCase( g.getName() ) )
         {
            roleGroup = g;
            break;
         }
      }

      if (roleGroup == null) roleGroup = new SimpleGroup(ROLES_GROUP);

      for (String role : roles)
      {
         roleGroup.addMember(new SimplePrincipal(role));
      }
     
      subject.getPrincipals().add(roleGroup);
     
      return true;
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);
View Full Code Here

TOP

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

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.