*/
package org.wamblee.security.authorization;
-import static org.wamblee.security.authorization.AuthorizationResult.DENIED;
-import static org.wamblee.security.authorization.AuthorizationResult.GRANTED;
+import static org.wamblee.security.authorization.AuthorizationResult.*;
-import org.wamblee.usermgt.User;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.Transient;
/**
* Test authorization rule that also counts the number of times the rule
*
* @author Erik Brakkee
*/
+@Entity
+@DiscriminatorValue("TEST")
public class TestAuthorizationRule extends UrlAuthorizationRule {
/**
* Counts the number of matches.
*/
+ @Transient
private int matches = 0;
/**
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);