X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;ds=inline;f=security%2Fimpl%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsecurity%2Fauthorization%2FUrlAuthorizationRule.java;h=17bdc348ae8263b97c7ca000d6da2b0414ebe476;hb=a0ce32a7a71799300bbf300cf71e76e1782392d3;hp=c2834935a473d3967228cad0379e02fc582468b1;hpb=c478cc74b468910f649f044b916359a8187af9e8;p=utils
diff --git a/security/impl/src/main/java/org/wamblee/security/authorization/UrlAuthorizationRule.java b/security/impl/src/main/java/org/wamblee/security/authorization/UrlAuthorizationRule.java
index c2834935..17bdc348 100644
--- a/security/impl/src/main/java/org/wamblee/security/authorization/UrlAuthorizationRule.java
+++ b/security/impl/src/main/java/org/wamblee/security/authorization/UrlAuthorizationRule.java
@@ -17,10 +17,12 @@ package org.wamblee.security.authorization;
import static org.wamblee.security.authorization.AuthorizationResult.*;
+import javax.enterprise.inject.Typed;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.CascadeType;
import javax.persistence.Column;
+import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@@ -35,12 +37,12 @@ import org.wamblee.usermgt.User;
*
The path of the resource. To obtain the path of a resource, subclasses
* must implement {@link #getResourcePath(Object)}. Whether a path is
* appropriate is determined by a
- * {@link org.wamblee.security.authorization.PathCondition}.
+ * {@link org.wamblee.security.authorization.AbstractPathCondition}.
* The user identity with which the resource is accessed. Whether a user is
* appropriate is determined by a
- * {@link org.wamblee.security.authorization.UserCondition}.
+ * {@link org.wamblee.security.authorization.AbstractUserCondition}.
* The operation that is requested. Whether the operation is appropriate is
- * determined by a {@link org.wamblee.security.authorization.OperationCondition}
+ * determined by a {@link org.wamblee.security.authorization.AbstractOperationCondition}
* .
*
* In case all three conditions match, the condition returns the configured
@@ -50,7 +52,7 @@ import org.wamblee.usermgt.User;
*/
@Entity
@Access(AccessType.PROPERTY)
-public abstract class UrlAuthorizationRule extends AuthorizationRule {
+public abstract class UrlAuthorizationRule extends AbstractAuthorizationRule {
private static final Logger LOGGER = Logger
.getLogger(UrlAuthorizationRule.class);
@@ -77,6 +79,7 @@ public abstract class UrlAuthorizationRule extends AuthorizationRule {
/**
* Operation that this rule is for.
*/
+
private OperationCondition operationCondition;
/**
@@ -261,7 +264,7 @@ public abstract class UrlAuthorizationRule extends AuthorizationRule {
*
* @return Returns the operationCondition.
*/
- @ManyToOne(cascade = CascadeType.ALL)
+ @ManyToOne(cascade = CascadeType.ALL, targetEntity = AbstractOperationCondition.class)
@JoinColumn(name = "OPER_COND_PK")
public OperationCondition getOperationCondition() {
return operationCondition;
@@ -280,7 +283,7 @@ public abstract class UrlAuthorizationRule extends AuthorizationRule {
*
* @return Returns the pathCondition.
*/
- @ManyToOne(cascade = CascadeType.ALL)
+ @ManyToOne(cascade = CascadeType.ALL, targetEntity = AbstractPathCondition.class)
@JoinColumn(name = "PATH_COND_PK")
public PathCondition getPathCondition() {
return pathCondition;
@@ -299,7 +302,7 @@ public abstract class UrlAuthorizationRule extends AuthorizationRule {
*
* @return Returns the userCondition.
*/
- @ManyToOne(cascade = CascadeType.ALL)
+ @ManyToOne(cascade = CascadeType.ALL, targetEntity = AbstractUserCondition.class)
@JoinColumn(name = "USER_COND_PK")
public UserCondition getUserCondition() {
return userCondition;