diff --git a/docs/modules/ROOT/pages/servlet/authorization/architecture.adoc b/docs/modules/ROOT/pages/servlet/authorization/architecture.adoc index f4ca5b07e9..cbdadfc1e6 100644 --- a/docs/modules/ROOT/pages/servlet/authorization/architecture.adoc +++ b/docs/modules/ROOT/pages/servlet/authorization/architecture.adoc @@ -196,22 +196,25 @@ A typical configuration might look like this: [source,java,role="primary"] ---- @Bean -AccessDecisionVoter hierarchyVoter() { +static RoleHierarchy roleHierarchy() { RoleHierarchy hierarchy = new RoleHierarchyImpl(); hierarchy.setHierarchy("ROLE_ADMIN > ROLE_STAFF\n" + "ROLE_STAFF > ROLE_USER\n" + "ROLE_USER > ROLE_GUEST"); - return new RoleHierarchyVoter(hierarchy); +} + +// and, if using method security also add +@Bean +static MethodSecurityExpressionHandler methodSecurityExpressionHandler(RoleHierarchy roleHierarchy) { + DefaultMethodSecurityExpressionHandler expressionHandler = new DefaultMethodSecurityExpressionHandler(); + expressionHandler.setRoleHierarchy(roleHierarchy); + return expressionHandler; } ---- .Xml [source,java,role="secondary"] ---- - - - - @@ -222,6 +225,12 @@ AccessDecisionVoter hierarchyVoter() { + + + + + ---- ====