Javadoc
A simple
PermissionMapper implementation that maps to pre-defined
PermissionVerifier instances.
This
PermissionMapper is constructed using a
Builder which is used to construct an ordered list of
PermissionVerifier instances 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
Principal within the
PermissionMappable is contained
within the mapping or the
Roles in the
mapPermission call contain at least one of the roles in the mapping
then the associated
PermissionVerifier will 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
Builder#setMappingMode(SimplePermissionMapper.MappingMode) to choose a different mode to combine the resulting
PermissionVerifier instances.