public class SimplePermissionMapper extends Object implements PermissionMapper
PermissionMapperimplementation that maps to pre-defined
PermissionMapperis constructed using a
SimplePermissionMapper.Builderwhich is used to construct an ordered list of
PermissionVerifierinstances along with a set of principal names and a list of principal names. At the time
mapPermissions(PermissionMappable, Roles)is called this list is iterated to find corresponding definitions where either the name of the
PermissionMappableis contained within the mapping or the
mapPermissioncall contain at least one of the roles in the mapping then the associated
PermissionVerifierwill be used. It is possible that multiple mappings could be matched during the call to
mapPermissions(PermissionMappable, Roles)and this is why the ordering is important, by default only the first match will be used however this can be overridden by calling
SimplePermissionMapper.Builder.setMappingMode(SimplePermissionMapper.MappingMode)to choose a different mode to combine the resulting
|Modifier and Type||Class and Description|
A builder for simple permission mappers.
Mode defining behaviour when multiple mappings are found.
|Modifier and Type||Method and Description|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public PermissionVerifier mapPermissions(PermissionMappable permissionMappable, Roles roles)
PermissionVerifier with all the permissions associated with the given information.
Once returned, client code can use the
PermissionVerifier.implies(Permission) to check if a given permission is granted or not
to the given principal. Implementors must make sure that the returned collection is immutable.
Copyright © 2021 JBoss by Red Hat. All rights reserved.