SEC-262: Refactor common method into superclass.
This commit is contained in:
parent
d795836bf1
commit
07e805e342
|
@ -19,6 +19,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
|
||||
import org.acegisecurity.AccessDecisionManager;
|
||||
import org.acegisecurity.AccessDeniedException;
|
||||
import org.acegisecurity.AcegiMessageSource;
|
||||
import org.acegisecurity.ConfigAttribute;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
@ -138,4 +139,12 @@ public abstract class AbstractAccessDecisionManager
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected final void checkAllowIfAllAbstainDecisions() {
|
||||
if (!this.isAllowIfAllAbstainDecisions()) {
|
||||
throw new AccessDeniedException(messages.getMessage(
|
||||
"AbstractAccessDecisionManager.accessDenied",
|
||||
"Access is denied"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,12 +79,6 @@ public class AffirmativeBased extends AbstractAccessDecisionManager {
|
|||
}
|
||||
|
||||
// To get this far, every AccessDecisionVoter abstained
|
||||
if (this.isAllowIfAllAbstainDecisions()) {
|
||||
return;
|
||||
} else {
|
||||
throw new AccessDeniedException(messages.getMessage(
|
||||
"AbstractAccessDecisionManager.accessDenied",
|
||||
"Access is denied"));
|
||||
}
|
||||
checkAllowIfAllAbstainDecisions();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,13 +108,7 @@ public class ConsensusBased extends AbstractAccessDecisionManager {
|
|||
}
|
||||
|
||||
// To get this far, every AccessDecisionVoter abstained
|
||||
if (this.isAllowIfAllAbstainDecisions()) {
|
||||
return;
|
||||
} else {
|
||||
throw new AccessDeniedException(messages.getMessage(
|
||||
"AbstractAccessDecisionManager.accessDenied",
|
||||
"Access is denied"));
|
||||
}
|
||||
checkAllowIfAllAbstainDecisions();
|
||||
}
|
||||
|
||||
public boolean isAllowIfEqualGrantedDeniedDecisions() {
|
||||
|
|
|
@ -106,12 +106,6 @@ public class UnanimousBased extends AbstractAccessDecisionManager {
|
|||
}
|
||||
|
||||
// To get this far, every AccessDecisionVoter abstained
|
||||
if (this.isAllowIfAllAbstainDecisions()) {
|
||||
return;
|
||||
} else {
|
||||
throw new AccessDeniedException(messages.getMessage(
|
||||
"AbstractAccessDecisionManager.accessDenied",
|
||||
"Access is denied"));
|
||||
}
|
||||
checkAllowIfAllAbstainDecisions();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue