[jboss-cvs] jboss-seam/src/main/org/jboss/seam/security ...

Shane Bryzak sbryzak at redhat.com
Sun Feb 25 01:04:34 EST 2007


  User: sbryzak2
  Date: 07/02/25 01:04:34

  Modified:    src/main/org/jboss/seam/security   Identity.java
                        RuleBasedIdentity.java
  Log:
  consistency with JBoss SX
  
  Revision  Changes    Path
  1.72      +8 -6      jboss-seam/src/main/org/jboss/seam/security/Identity.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Identity.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/Identity.java,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -b -r1.71 -r1.72
  --- Identity.java	24 Feb 2007 22:07:28 -0000	1.71
  +++ Identity.java	25 Feb 2007 06:04:34 -0000	1.72
  @@ -53,6 +53,8 @@
   @Startup
   public class Identity extends Selector
   {  
  +   public static final String ROLES_GROUP = "Roles";
  +   
      private static final long serialVersionUID = 3751659008033189259L;
      
      private static final LogProvider log = Logging.getLogProvider(Identity.class);
  @@ -289,7 +291,7 @@
      }
      
      /**
  -    * Removes all Role objects from the security context, removes the "roles"
  +    * Removes all Role objects from the security context, removes the "Roles"
       * group from the user's subject.
       *
       */
  @@ -297,7 +299,7 @@
      {      
         for ( Group sg : subject.getPrincipals(Group.class) )      
         {
  -         if ( "roles".equalsIgnoreCase( sg.getName() ) )
  +         if ( ROLES_GROUP.equals( sg.getName() ) )
            {
               subject.getPrincipals().remove(sg);
               break;
  @@ -333,7 +335,7 @@
      {
         for ( Group sg : subject.getPrincipals(Group.class) )      
         {
  -         if ( "roles".equalsIgnoreCase( sg.getName() ) )
  +         if ( ROLES_GROUP.equals( sg.getName() ) )
            {
               return sg.isMember( new SimplePrincipal(role) );
            }
  @@ -357,13 +359,13 @@
         {
            for ( Group sg : subject.getPrincipals(Group.class) )      
            {
  -            if ( "roles".equalsIgnoreCase( sg.getName() ) )
  +            if ( ROLES_GROUP.equals( sg.getName() ) )
               {
                  return sg.addMember(new SimplePrincipal(role));
               }
            }
                     
  -         SimpleGroup roleGroup = new SimpleGroup("roles");
  +         SimpleGroup roleGroup = new SimpleGroup(ROLES_GROUP);
            roleGroup.addMember(new SimplePrincipal(role));
            subject.getPrincipals().add(roleGroup);
            return true;
  @@ -379,7 +381,7 @@
      {     
         for ( Group sg : subject.getPrincipals(Group.class) )      
         {
  -         if ( "roles".equalsIgnoreCase( sg.getName() ) )
  +         if ( ROLES_GROUP.equals( sg.getName() ) )
            {
               Enumeration e = sg.members();
               while (e.hasMoreElements())
  
  
  
  1.7       +1 -1      jboss-seam/src/main/org/jboss/seam/security/RuleBasedIdentity.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RuleBasedIdentity.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/RuleBasedIdentity.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- RuleBasedIdentity.java	25 Feb 2007 02:41:49 -0000	1.6
  +++ RuleBasedIdentity.java	25 Feb 2007 06:04:34 -0000	1.7
  @@ -76,7 +76,7 @@
            // Populate the working memory with the user's principals
            for ( Principal p : getSubject().getPrincipals() )
            {         
  -            if ( (p instanceof Group) && "roles".equalsIgnoreCase( ( (Group) p ).getName() ) )
  +            if ( (p instanceof Group) && ROLES_GROUP.equals( ( (Group) p ).getName() ) )
               {
                  Enumeration e = ( (Group) p ).members();
                  while ( e.hasMoreElements() )
  
  
  



More information about the jboss-cvs-commits mailing list