add prefixed ROLE_ to granted authorities to work with out-of-the-box
spring security Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
@@ -36,6 +36,9 @@ public final class PermissionUtils {
|
|||||||
|
|
||||||
for (final String role : roles) {
|
for (final String role : roles) {
|
||||||
authorities.add(new SimpleGrantedAuthority(role));
|
authorities.add(new SimpleGrantedAuthority(role));
|
||||||
|
// add spring security ROLE authority which is indicated by the
|
||||||
|
// `ROLE_` prefix
|
||||||
|
authorities.add(new SimpleGrantedAuthority("ROLE_" + role));
|
||||||
}
|
}
|
||||||
|
|
||||||
return authorities;
|
return authorities;
|
||||||
|
|||||||
Reference in New Issue
Block a user