now using the simplified user management interface.
[utils] / security / impl / src / test / java / org / wamblee / security / authorization / TestAuthorizationRule.java
index 9d6000b9f4d6e78c6363df81181b254d83318751..2cae273264ea86f705bb8f34d382ab3be46d27f9 100644 (file)
@@ -18,7 +18,11 @@ package org.wamblee.security.authorization;
 import static org.wamblee.security.authorization.AuthorizationResult.DENIED;
 import static org.wamblee.security.authorization.AuthorizationResult.GRANTED;
 
-import org.wamblee.usermgt.User;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.Transient;
+
+import org.wamblee.security.authentication.User;
 
 /**
  * Test authorization rule that also counts the number of times the rule
@@ -26,10 +30,13 @@ import org.wamblee.usermgt.User;
  * 
  * @author Erik Brakkee
  */
+@Entity
+@DiscriminatorValue("TEST")
 public class TestAuthorizationRule extends UrlAuthorizationRule {
     /**
      * Counts the number of matches.
      */
+    @Transient
     private int matches = 0;
 
     /**
@@ -62,17 +69,9 @@ public class TestAuthorizationRule extends UrlAuthorizationRule {
         return ((TestResource) aResource).getPath();
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.wamblee.security.authorization.UrlAuthorizationRule#isAllowed(java
-     * .lang.Object, org.wamblee.security.authorization.Operation,
-     * org.wamblee.usermgt.UserAccessor)
-     */
     @Override
     public AuthorizationResult isAllowed(Object aResource,
-        Operation aOperation, User aUser) {
+        Operation aOperation, String aUser) {
         AuthorizationResult result = super.isAllowed(aResource, aOperation,
             aUser);