diff --git a/docs/modules/ROOT/pages/servlet/authorization/method-security.adoc b/docs/modules/ROOT/pages/servlet/authorization/method-security.adoc index 903fcb5ac1..6e72929dca 100644 --- a/docs/modules/ROOT/pages/servlet/authorization/method-security.adoc +++ b/docs/modules/ROOT/pages/servlet/authorization/method-security.adoc @@ -216,13 +216,15 @@ Java:: ---- @PreAuthorize("hasAuthority('permission:read') || hasRole('ADMIN')") ---- -====== -.Kotlin -[source,kotlin,role="kotlin"] +Kotlin:: ++ +[source,kotlin,role="secondary"] ---- @PreAuthorize("hasAuthority('permission:read') || hasRole('ADMIN')") ---- +====== + However, you could instead grant `permission:read` to those with `ROLE_ADMIN`. One way to do this is with a `RoleHierarchy` like so: