Skip to content

GlobalMethodSecurity and multiple annotation ordering #4103

@vguna

Description

@vguna

Summary

Adding multiple security annotations to a method like this:

@RolesAllowed("ROLE_ADMIN")
@PostAuthorize("hasPermission(...)")
public SomeObject doSomething() {
}

leads to the effect, that @RolesAllowed doesn't seem to be checked anymore if @PostAuthorize returned true.

Actual Behavior

Since @PostAuthorize returns true, @RolesAllowed seems not evaluated anymore.
If I remove the @PostAuthorize access is denied as expected.

Is there something to change the actual behavior?

Expected Behavior

All annotations are processed and if at least one denies access, the complete access should be denied.

Configuration

See code snippet above.

Version

3.2.5-RELEASE

Metadata

Metadata

Assignees

Labels

in: coreAn issue in spring-security-coretype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions