Sanjay Amin
Sanjay Amin

Reputation: 411

spring boot @PreAuthorize hasAuthority and hasRole

I'm trying to use @PreAuthorize("hasAuthority('READ'), hasRole('ADMIN')") that throws parsing exception.

How can I use hasAuthority and hasRole with @PreAuthorize in Spring boot controller?

Upvotes: 0

Views: 1146

Answers (1)

Sanjay Amin
Sanjay Amin

Reputation: 411

This worked as

@PreAuthorize("hasAuthority('READ') and hasRole('ADMIN')")

Upvotes: 1

Related Questions