@FunctionalInterface public interface PermissionMapper
SecurityDomain
in order to obtain and check permissions based on an previously authorized identity and any other authorization information (eg.: roles)
associated with it.Modifier and Type | Field and Description |
---|---|
static PermissionMapper |
EMPTY_PERMISSION_MAPPER
A default implementation that does nothing but returns an empty and read-only
PermissionVerifier . |
Modifier and Type | Method and Description |
---|---|
default PermissionMapper |
and(PermissionMapper other)
Returns a new mapper where the
PermissionVerifier created by this PermissionMapper is combined with the
PermissionVerifier of the other PermissionMapper using 'and'. |
static PermissionMapper |
createConstant(PermissionVerifier verifier)
Returns a new mapper that maps all to pre-defined
PermissionVerifier instance. |
PermissionVerifier |
mapPermissions(PermissionMappable permissionMappable,
Roles roles)
Returns a
PermissionVerifier with all the permissions associated with the given information. |
default PermissionMapper |
or(PermissionMapper other)
Returns a new mapper where the
PermissionVerifier created by this PermissionMapper is combined with the
PermissionVerifier of the other PermissionMapper using 'or'. |
default PermissionMapper |
unless(PermissionMapper other)
Returns a new mapper where the
PermissionVerifier created by this PermissionMapper is combined with the
PermissionVerifier of the other PermissionMapper using 'unless'. |
default PermissionMapper |
xor(PermissionMapper other)
Returns a new mapper where the
PermissionVerifier created by this PermissionMapper is combined with the
PermissionVerifier of the other PermissionMapper using 'xor'. |
static final PermissionMapper EMPTY_PERMISSION_MAPPER
PermissionVerifier
.PermissionVerifier mapPermissions(PermissionMappable permissionMappable, Roles roles)
Returns a 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.
permissionMappable
- the object to which permissions can be mapped (must not be null
)roles
- a set of effective roles after all role mapping was applied by security domain (may be null
)null
)default PermissionMapper and(PermissionMapper other)
PermissionVerifier
created by this PermissionMapper
is combined with the
PermissionVerifier
of the other
PermissionMapper
using 'and'.other
- the other PermissionMapper
to combine with this PermissionMapper
PermissionMapper
default PermissionMapper or(PermissionMapper other)
PermissionVerifier
created by this PermissionMapper
is combined with the
PermissionVerifier
of the other
PermissionMapper
using 'or'.other
- the other PermissionMapper
to combine with this PermissionMapper
PermissionMapper
default PermissionMapper xor(PermissionMapper other)
PermissionVerifier
created by this PermissionMapper
is combined with the
PermissionVerifier
of the other
PermissionMapper
using 'xor'.other
- the other PermissionMapper
to combine with this PermissionMapper
PermissionMapper
default PermissionMapper unless(PermissionMapper other)
PermissionVerifier
created by this PermissionMapper
is combined with the
PermissionVerifier
of the other
PermissionMapper
using 'unless'.other
- the other PermissionMapper
to combine with this PermissionMapper
PermissionMapper
static PermissionMapper createConstant(PermissionVerifier verifier)
PermissionVerifier
instance.verifier
- the PermissionVerifier
that will be returned for anybody.PermissionVerifier
Copyright © 2020 JBoss by Red Hat. All rights reserved.