diff --git a/src/main/java/com/digitalsanctuary/spring/user/util/WebSecurityConfig.java b/src/main/java/com/digitalsanctuary/spring/user/util/WebSecurityConfig.java index f6bb6dc..a079018 100644 --- a/src/main/java/com/digitalsanctuary/spring/user/util/WebSecurityConfig.java +++ b/src/main/java/com/digitalsanctuary/spring/user/util/WebSecurityConfig.java @@ -225,8 +225,7 @@ public SessionRegistry sessionRegistry() { @Bean public RoleHierarchy roleHierarchy() { - RoleHierarchyImpl roleHierarchy = new RoleHierarchyImpl(); - roleHierarchy.setHierarchy(rolesAndPrivilegesConfig.getRoleHierarchyString()); + RoleHierarchyImpl roleHierarchy = RoleHierarchyImpl.fromHierarchy(rolesAndPrivilegesConfig.getRoleHierarchyString()); log.debug("WebSecurityConfig.roleHierarchy: roleHierarchy: {}", roleHierarchy.toString()); return roleHierarchy; } @@ -246,7 +245,7 @@ public HttpSessionEventPublisher httpSessionEventPublisher() { /** * This is required to publish authentication events to the Spring event system. This allows us to listen for authentication events and perform * actions based on successful or failed authentication. - * + * * @param applicationEventPublisher * @return the Spring Security default AuthenticationEventPublisher */