lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andr...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/workflow/impl RoleCondition.java
Date Wed, 28 May 2003 15:26:52 GMT
andreas     2003/05/28 08:26:52

  Modified:    src/java/org/apache/lenya/cms/workflow/impl
                        RoleCondition.java
  Log:
  formatting changed
  
  Revision  Changes    Path
  1.4       +18 -10    cocoon-lenya/src/java/org/apache/lenya/cms/workflow/impl/RoleCondition.java
  
  Index: RoleCondition.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/workflow/impl/RoleCondition.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RoleCondition.java	28 May 2003 14:45:19 -0000	1.3
  +++ RoleCondition.java	28 May 2003 15:26:52 -0000	1.4
  @@ -19,9 +19,8 @@
    *
    * @author  andreas
    */
  -public class RoleCondition
  -    implements Condition {
  -    
  +public class RoleCondition implements Condition {
  +
       /**
        * Returns if the condition is complied in a certain situation.
        * The condition is complied when the current user has the
  @@ -29,8 +28,10 @@
        * @param situation The situation to check.
        * @return if the condition is complied.
        */
  -        public boolean isComplied(Situation situation) {
  -        User user = situation.getUser();
  +    public boolean isComplied(Situation situation) {
  +
  +        CMSSituation situationImpl = (CMSSituation) situation;
  +        User user = situationImpl.getUser();
           Iterator userGroups = user.getGroups();
           Set userRoles = null;
           
  @@ -42,7 +43,7 @@
           }
           
           Role conditionRole = new Role(getExpression().trim());
  -        
  +
           boolean complied = false;
           Iterator roles = userRoles.iterator();
           while (!complied && roles.hasNext()) {
  @@ -52,9 +53,9 @@
           }
           return complied;
       }
  -    
  +
       private String expression;
  -        
  +
       /** Sets the expression for this condition.
        * @param expression The expression.
        *
  @@ -63,9 +64,16 @@
           assert expression != null;
           this.expression = expression;
       }
  -    
  +
       public String getExpression() {
           return expression;
       }
  -    
  +
  +    /* (non-Javadoc)
  +     * @see java.lang.Object#toString()
  +     */
  +    public String toString() {
  +        return getExpression();
  +    }
  +
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org


Mime
View raw message