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

Norman Richards norman.richards at jboss.com
Tue Jul 17 18:17:58 EDT 2007


  User: nrichards
  Date: 07/07/17 18:17:58

  Modified:    src/main/org/jboss/seam/security  RuleBasedIdentity.java
  Log:
  JBSEAM-1635
  
  Revision  Changes    Path
  1.16      +14 -10    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.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- RuleBasedIdentity.java	11 Jul 2007 22:43:01 -0000	1.15
  +++ RuleBasedIdentity.java	17 Jul 2007 22:17:58 -0000	1.16
  @@ -38,6 +38,8 @@
   @Startup
   public class RuleBasedIdentity extends Identity
   {  
  +   private static final long serialVersionUID = -2798083003251077858L;
  +
      public static final String RULES_COMPONENT_NAME = "securityRules";   
      
      private static final LogProvider log = Logging.getLogProvider(RuleBasedIdentity.class);
  @@ -90,12 +92,12 @@
                  while ( e.hasMoreElements() )
                  {
                     Principal role = (Principal) e.nextElement();
  -                  securityContext.assertObject( new Role( role.getName() ) );
  +                  securityContext.insert( new Role( role.getName() ) );
                  }
               }     
            }
            
  -         securityContext.assertObject(getPrincipal());
  +         securityContext.insert(getPrincipal());
         }
      }
      
  @@ -120,7 +122,7 @@
         
         synchronized( securityContext )
         {
  -         handles.add( securityContext.assertObject(check) );
  +         handles.add( securityContext.insert(check) );
            
            for (int i = 0; i < arg.length; i++)
            {
  @@ -130,25 +132,26 @@
                  {
                     if ( securityContext.getFactHandle(value) == null )
                     {
  -                     handles.add( securityContext.assertObject(value) );
  +                     handles.add( securityContext.insert(value) );
                     }
                  }               
               }
               else
               {
  -               handles.add( securityContext.assertObject(arg[i]) );
  +               handles.add( securityContext.insert(arg[i]) );
               }
            }
      
            securityContext.fireAllRules();
      
            for (FactHandle handle : handles)
  -            securityContext.retractObject(handle);
  +            securityContext.retract(handle);
         }
         
         return check.isGranted();
      }
      
  +   @SuppressWarnings("unchecked")
      @Override
      protected void unAuthenticate()
      {
  @@ -159,7 +162,7 @@
            Iterator<Role> iter = securityContext.iterateObjects(new ClassObjectFilter(Role.class)); 
            while (iter.hasNext()) 
            {
  -            getSecurityContext().retractObject(securityContext.getFactHandle(iter.next()));
  +            getSecurityContext().retract(securityContext.getFactHandle(iter.next()));
            }
         }
         
  @@ -175,7 +178,7 @@
            
            if (securityContext != null)
            {
  -            getSecurityContext().assertObject(new Role(role));
  +            getSecurityContext().insert(new Role(role));
               return true;
            }
         }
  @@ -183,6 +186,7 @@
         return false;
      }
      
  +   @SuppressWarnings("unchecked")
      @Override
      public void removeRole(String role)
      {
  @@ -197,7 +201,7 @@
               if (r.getName().equals(role))
               {
                  FactHandle fh = getSecurityContext().getFactHandle(r);
  -               getSecurityContext().retractObject(fh);
  +               getSecurityContext().retract(fh);
                  break;
               }
            }
  
  
  



More information about the jboss-cvs-commits mailing list