@FunctionalInterface public interface PermissionVerifier
Modifier and Type | Field and Description |
---|---|
static PermissionVerifier |
ALL
A verifier which implies all permissions.
|
static PermissionVerifier |
NONE
A verifier which implies no permissions.
|
Modifier and Type | Method and Description |
---|---|
default PermissionVerifier |
and(PermissionVerifier other)
Return a new verifier which implies permissions which are implied both by this verifier and by the given verifier.
|
default void |
checkPermission(Permission permission)
Check a permission, throwing an exception if the permission is not implied.
|
static PermissionVerifier |
from(Permission permission)
Get a permission verifier for a single permission.
|
static PermissionVerifier |
from(PermissionCollection permissionCollection)
Get a permission verifier for a permission collection.
|
static PermissionVerifier |
from(Policy policy,
ProtectionDomain protectionDomain)
Get a permission verifier for a policy's view of a protection domain.
|
static PermissionVerifier |
from(ProtectionDomain protectionDomain)
Get a permission verifier for a protection domain.
|
boolean |
implies(Permission permission)
Determine if the permission is verified by this object.
|
default PermissionVerifier |
not()
Return a new verifier which implies the opposite of this verifier.
|
default PermissionVerifier |
or(PermissionVerifier other)
Return a new verifier which implies permissions which are implied either by this verifier or by the given verifier.
|
default PermissionCollection |
toPermissionCollection()
Convert this verifier a permission collection which implies everything this verifier implies.
|
default PermissionVerifier |
unless(PermissionVerifier other)
Return a new verifier which implies permissions which are implied by this verifier but not the given verifier.
|
default PermissionVerifier |
xor(PermissionVerifier other)
Return a new verifier which implies permissions which are implied by only one of this verifier or the given verifier.
|
static final PermissionVerifier NONE
static final PermissionVerifier ALL
boolean implies(Permission permission)
permission
- the permission to verify (must not be null
)true
if the permission is implied by this verifier, false
otherwisedefault PermissionVerifier and(PermissionVerifier other)
other
- the other verifier (must not be null
)null
)default PermissionVerifier or(PermissionVerifier other)
other
- the other verifier (must not be null
)null
)default PermissionVerifier xor(PermissionVerifier other)
other
- the other verifier (must not be null
)null
)default PermissionVerifier not()
null
)default PermissionVerifier unless(PermissionVerifier other)
other
- the other verifier (must not be null
)null
)default void checkPermission(Permission permission) throws SecurityException
permission
- the permission to check (must not be null
)SecurityException
- if the permission is not impliedstatic PermissionVerifier from(Permission permission)
permission
- the permission (must not be null
)null
)static PermissionVerifier from(PermissionCollection permissionCollection)
permissionCollection
- the permission collection (must not be null
)null
)static PermissionVerifier from(ProtectionDomain protectionDomain)
protectionDomain
- the protection domain (must not be null
)null
)static PermissionVerifier from(Policy policy, ProtectionDomain protectionDomain)
policy
- the policy (must not be null
)protectionDomain
- the protection domain (must not be null
)null
)default PermissionCollection toPermissionCollection()
PermissionCollection
instance, then this instance may be cast and returned. Otherwise,
this method may return a new, read-only collection, which cannot be iterated.null
)Copyright © 2017 JBoss by Red Hat. All rights reserved.