Answers for "spring preauthorize two roles"

0

spring preauthorize two roles

@PreAuthorize("hasRole('ROLE_VIEWER') or hasRole('ROLE_EDITOR')")
public boolean isValidUsername3(String username) {
    //...
}
Posted by: Guest on April-27-2021
0

spring preauthorize two roles

hasAnyRole() 

When you need to support multiple roles, you can use the hasAnyRole() expression.

@PreAuthorize("hasAnyRole('ADMIN','DB-ADMIN')")
Posted by: Guest on April-27-2021

Browse Popular Code Answers by Language