Spring MVC Authority loaded externally

95 Views Asked by At

I'm using spring mvc 4 and I have some rest services. Some of these methods are annotated with:

@PreAuthorize("hasAnyAuthority('myAuth1', 'myAuth2', 'myAuth3')")

So do you know if is there a way to load my permissions ('myAuth1', 'myAuth2', 'myAuth3') from an external method (maybe it load that from DB)?

Something like this:

@PreAuthorize("hasAnyAuthority(getExtAuthForService('myService'))")

Thanks all Have a good day

Fabrizio

0

There are 0 best solutions below