Polish RoleHierarchyImpl#Builder
- Added documentation - Removed withNoRolePrefix for now; let's see how folks use the minimal API first - Adjusted class hierarchy to match AuthorizeHttpRequests more closely - Adjusted to match Spring Security style guide - Added needed @since attributes Issue gh-13300
This commit is contained in:
@@ -253,11 +253,10 @@ Java::
|
||||
----
|
||||
@Bean
|
||||
static RoleHierarchy roleHierarchy() {
|
||||
RoleHierarchyImpl hierarchy = new RoleHierarchyImpl();
|
||||
hierarchy.setHierarchy("ROLE_ADMIN > ROLE_STAFF\n" +
|
||||
"ROLE_STAFF > ROLE_USER\n" +
|
||||
"ROLE_USER > ROLE_GUEST");
|
||||
return hierarchy;
|
||||
return RoleHierarchyImpl.withDefaultRolePrefix()
|
||||
.role("ADMIN").implies("STAFF")
|
||||
.role("STAFF").implies("USER")
|
||||
.role("USER").implies("GUEST");
|
||||
}
|
||||
|
||||
// and, if using method security also add
|
||||
|
||||
Reference in New Issue
Block a user