-
Task
-
Resolution: Done
-
Major
-
14.0.2.Final
-
None
1) in Embedded guide, the code snippet here (in 3.2 chapter's 3rd point) does not compile, the GlobalRoleConfigurationBuilder should be GlobalConfigurationBuilder.
So the code should look like:
GlobalConfigurationBuilder global = new GlobalConfigurationBuilder(); global.security().authorization().enable() .principalRoleMapper(new ClusterRoleMapper()) .role("admin").permission(AuthorizationPermission.ADMIN) .role("reader").permission(AuthorizationPermission.ALL_READ); 2) In 3.3 chapter's procedure's 2nd point the code doesn't compile. The MutablePermissionMapper should be MutableRolePermissionMapper .
So the code should look like:
MutableRolePermissionMapper mapper = (MutableRolePermissionMapper) cacheManager.getCacheManagerConfiguration().security().authorization().rolePermissionMapper(); mapper.addRole(Role.newRole("myroleone", true, AuthorizationPermission.ALL_WRITE, AuthorizationPermission.LISTEN)); mapper.addRole(Role.newRole("myroletwo", true, AuthorizationPermission.READ, AuthorizationPermission.WRITE));
3) In 3.4 chapter's procedure's 2nd point the code doesn't compile because of missing brackets. The code should be:
Security.doAs(mySubject, (PrivilegedAction<String>)() -> cache.put("key", "value"));