Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEC-262: AbstractAccessDecisionManager needs standard handling ifAllAbstainDecisions #520

Closed
spring-issuemaster opened this issue May 3, 2006 · 1 comment

Comments

@spring-issuemaster
Copy link

@spring-issuemaster spring-issuemaster commented May 3, 2006

Fabio Grassi(Migrated from SEC-262) said:

All three classes derived from AbstractAccessDecisionManager (AffirmativeBased, ConsensusBased, UnanimousBased) use the following very same piece of code to decide what to do in case of abstainsion:

```
if (this.isAllowIfAllAbstainDecisions()) {
return;
} else {
throw new AccessDeniedException(messages.getMessage(
“AbstractAccessDecisionManager.accessDenied”,
“Access is denied”));
}
```

I think it would make sense to factor this into a method of the parent (AbstractAccessDecisionManager ) class more or less like this:

protected final void checkAllowIfAllAbstainDecisions() {
if (!this.isAllowIfAllAbstainDecisions()) {
throw new AccessDeniedException(messages.getMessage(
“AbstractAccessDecisionManager.accessDenied”,
“Access is denied”));
}
}

This way the check in the child classes can be performed with a single, much more readable, method call.

@spring-issuemaster

This comment has been minimized.

Copy link
Author

@spring-issuemaster spring-issuemaster commented May 22, 2006

Ben Alex said:

Fixed in SVN, tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.