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:
Michael Hirsch
2016-06-22 15:47:38 +02:00
parent aef2e3450a
commit 11f2232247

View File

@@ -36,6 +36,9 @@ public final class PermissionUtils {
for (final String role : roles) {
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;