From 11f2232247276409643e7c4ebedcb8f482cd5061 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Wed, 22 Jun 2016 15:47:38 +0200 Subject: [PATCH] add prefixed ROLE_ to granted authorities to work with out-of-the-box spring security Signed-off-by: Michael Hirsch --- .../org/eclipse/hawkbit/im/authentication/PermissionUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/PermissionUtils.java b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/PermissionUtils.java index ae8b604bb..98cde9642 100644 --- a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/PermissionUtils.java +++ b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/PermissionUtils.java @@ -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;