Package org.wildfly.security.permission
Interface PermissionVerifier
- All Known Implementing Classes:
AbstractActionPermission,AbstractActionSetPermission,AbstractBooleanPermission,AbstractNamedPermission,AbstractNameOnlyPermission,AbstractNameSetOnlyPermission,AbstractNamingPermission,AbstractPermission,AbstractPermissionCollection,AbstractSimpleNamePermission,BooleanPermissionCollection,ByNamePermissionCollection,ChangeRoleMapperPermission,CredentialStorePermission,EJBClientPermission,ElytronPermission,LoginPermission,NameSetPermissionCollection,NoPermission,RemoteEJBPermission,RunAsPrincipalPermission,SecurityIdentity,SimpleActionBitsPermissionCollection,SimplePermissionCollection,WildFlySecurityManager,WildFlySecurityManagerPermission
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An interface for objects that can verify permissions.
- Author:
- David M. Lloyd
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PermissionVerifierA verifier which implies all permissions.static final PermissionVerifierA verifier which implies no permissions. -
Method Summary
Modifier and TypeMethodDescriptiondefault PermissionVerifierand(PermissionVerifier other) Return a new verifier which implies permissions which are implied both by this verifier and by the given verifier.default voidcheckPermission(Permission permission) Check a permission, throwing an exception if the permission is not implied.static PermissionVerifierfrom(Permission permission) Get a permission verifier for a single permission.static PermissionVerifierfrom(PermissionCollection permissionCollection) Get a permission verifier for a permission collection.static PermissionVerifierfrom(Policy policy, ProtectionDomain protectionDomain) Get a permission verifier for a policy's view of a protection domain.static PermissionVerifierfrom(ProtectionDomain protectionDomain) Get a permission verifier for a protection domain.booleanimplies(Permission permission) Determine if the permission is verified by this object.default PermissionVerifiernot()Return a new verifier which implies the opposite of this verifier.default PermissionVerifieror(PermissionVerifier other) Return a new verifier which implies permissions which are implied either by this verifier or by the given verifier.default PermissionCollectionConvert this verifier a permission collection which implies everything this verifier implies.default PermissionVerifierunless(PermissionVerifier other) Return a new verifier which implies permissions which are implied by this verifier but not the given verifier.default PermissionVerifierxor(PermissionVerifier other) Return a new verifier which implies permissions which are implied by only one of this verifier or the given verifier.
-
Field Details
-
NONE
A verifier which implies no permissions. -
ALL
A verifier which implies all permissions.
-
-
Method Details
-
implies
Determine if the permission is verified by this object.- Parameters:
permission- the permission to verify (must not benull)- Returns:
trueif the permission is implied by this verifier,falseotherwise
-
and
Return a new verifier which implies permissions which are implied both by this verifier and by the given verifier.- Parameters:
other- the other verifier (must not benull)- Returns:
- the new permission verifier (not
null)
-
or
Return a new verifier which implies permissions which are implied either by this verifier or by the given verifier.- Parameters:
other- the other verifier (must not benull)- Returns:
- the new permission verifier (not
null)
-
xor
Return a new verifier which implies permissions which are implied by only one of this verifier or the given verifier.- Parameters:
other- the other verifier (must not benull)- Returns:
- the new permission verifier (not
null)
-
not
Return a new verifier which implies the opposite of this verifier.- Returns:
- the new permission verifier (not
null)
-
unless
Return a new verifier which implies permissions which are implied by this verifier but not the given verifier.- Parameters:
other- the other verifier (must not benull)- Returns:
- the new permission verifier (not
null)
-
checkPermission
Check a permission, throwing an exception if the permission is not implied.- Parameters:
permission- the permission to check (must not benull)- Throws:
SecurityException- if the permission is not implied
-
from
Get a permission verifier for a single permission.- Parameters:
permission- the permission (must not benull)- Returns:
- the verifier (not
null)
-
from
Get a permission verifier for a permission collection.- Parameters:
permissionCollection- the permission collection (must not benull)- Returns:
- the verifier (not
null)
-
from
Get a permission verifier for a protection domain.- Parameters:
protectionDomain- the protection domain (must not benull)- Returns:
- the verifier (not
null)
-
from
Get a permission verifier for a policy's view of a protection domain.- Parameters:
policy- the policy (must not benull)protectionDomain- the protection domain (must not benull)- Returns:
- the verifier (not
null)
-
toPermissionCollection
Convert this verifier a permission collection which implies everything this verifier implies. If this instance is already aPermissionCollectioninstance, then this instance may be cast and returned. Otherwise, this method may return a new, read-only collection, which cannot be iterated.- Returns:
- the permission collection (not
null)
-