[Yanel-commits] rev 36359 - public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/workflow

michi at wyona.com michi at wyona.com
Tue May 6 10:17:01 CEST 2008


Author: michi
Date: 2008-05-06 10:17:01 +0200 (Tue, 06 May 2008)
New Revision: 36359

Modified:
   public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/workflow/RoleCondition.java
Log:
do not use deprecated method

Modified: public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/workflow/RoleCondition.java
===================================================================
--- public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/workflow/RoleCondition.java	2008-05-06 08:16:16 UTC (rev 36358)
+++ public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/workflow/RoleCondition.java	2008-05-06 08:17:01 UTC (rev 36359)
@@ -18,12 +18,16 @@
 import org.apache.log4j.Category;
 import org.wyona.security.core.api.Identity;
 import org.wyona.security.core.api.Role;
+import org.wyona.security.core.api.Usecase;
 import org.wyona.yanel.core.Resource;
 import org.wyona.yanel.core.api.attributes.WorkflowableV1;
 import org.wyona.yanel.core.workflow.Condition;
 import org.wyona.yanel.core.workflow.Workflow;
 import org.wyona.yanel.core.workflow.WorkflowException;
 
+/**
+ * @deprecated Use UsecaseCondition instead
+ */
 public class RoleCondition implements Condition {
     
     private static Category log = Category.getInstance(RoleCondition.class);
@@ -47,7 +51,7 @@
             }
             
             boolean authorized;
-            authorized = resource.getRealm().getPolicyManager().authorize(resource.getPath(), identity, this.role);
+            authorized = resource.getRealm().getPolicyManager().authorize(resource.getPath(), identity, new Usecase(this.role.getName()));
             if (log.isDebugEnabled()) {
                 log.debug("RoleCondition.isComplied():");
                 log.debug("   resource : " + resource.getPath());
@@ -62,4 +66,4 @@
         }
     }
 
-}
\ No newline at end of file
+}



More information about the Yanel-commits mailing list