Skip to content

Commit

Permalink
Enable both Simple and JsonFile PolicyDefinition, make JsonFile default
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa-eltaher committed Aug 16, 2016
1 parent d114df8 commit 8c30639
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.expression.EvaluationException;
import org.springframework.stereotype.Component;

Expand All @@ -14,6 +15,7 @@ public class BasicPolicyEnforcement implements PolicyEnforcement {
private static final Logger logger = LoggerFactory.getLogger(BasicPolicyEnforcement.class);

@Autowired
@Qualifier("jsonFilePolicyDefinition")
private PolicyDefinition policyDefinition;

/* (non-Javadoc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.stereotype.Component;

//@Component
@Component("simplePolicyDefinition")
public class SimplePolicyDefinition implements PolicyDefinition {
private List<PolicyRule> rules;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import edu.mostafa.abac.security.policy.PolicyDefinition;
import edu.mostafa.abac.security.policy.PolicyRule;

@Component
@Component("jsonFilePolicyDefinition")
public class JsonFilePolicyDefinition implements PolicyDefinition {
private static Logger logger = LoggerFactory.getLogger(JsonFilePolicyDefinition.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@Component
public class AbacPermissionEvaluator implements PermissionEvaluator {
private static Logger logger = LoggerFactory.getLogger(AbacPermissionEvaluator.class);

@Autowired
PolicyEnforcement policy;

Expand Down

0 comments on commit 8c30639

Please sign in to comment.