Class AllPermissionImpl
java.lang.Object
org.tentackle.security.permissions.AbstractPermission
org.tentackle.security.permissions.AllPermissionImpl
- All Implemented Interfaces:
Comparable<Permission>, Permission, AllPermission
@PermissionService(AllPermission.class)
public final class AllPermissionImpl
extends AbstractPermission
implements AllPermission
Permission that represents all other permissions.
- Author:
- harald
-
Field Summary
Fields inherited from interface AllPermission
NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether this permission applies to given class or instances of it.getName()Gets the unique name of the permission.
The name must conform to the rules of a java identifier, must be unique among all permissions and should be reasonably short.booleanisAllowedBy(Class<?>... permissions) Checks whether this requested permission is granted by at least one of the given permissions.
This is the case if a given permission is the same as or extends this permission, or is ALL.booleanisDeniedBy(Class<?>... permissions) Checks whether this requested permission is denied by at least one of the given permissions.
This is the case if this permission is the same as or extends a given permission, or a given one is ALL.Methods inherited from class AbstractPermission
compareTo, equals, getDescription, getPermissionInterface, hashCode, toStringMethods inherited from interface Comparable
compareToMethods inherited from interface Permission
getDescription, getPermissionInterface
-
Constructor Details
-
AllPermissionImpl
public AllPermissionImpl()Creates the "all" permission.
-
-
Method Details
-
getName
Description copied from interface:PermissionGets the unique name of the permission.
The name must conform to the rules of a java identifier, must be unique among all permissions and should be reasonably short.- Specified by:
getNamein interfacePermission- Returns:
- the name, never null
-
isAllowedBy
Checks whether this requested permission is granted by at least one of the given permissions.
This is the case if a given permission is the same as or extends this permission, or is ALL. For example, a requested READ is allowed by a configured EDIT, since EDIT implies READ.Requesting all permissions is only allowed if ALL is granted.
- Specified by:
isAllowedByin interfacePermission- Overrides:
isAllowedByin classAbstractPermission- Parameters:
permissions- the configured permission interfaces- Returns:
- true if matches
-
isDeniedBy
Checks whether this requested permission is denied by at least one of the given permissions.
This is the case if this permission is the same as or extends a given permission, or a given one is ALL. For example, a requested EDIT is denied by a configured READ, since EDIT cannot be granted without READ.Requesting all permissions is denied by the denial of any permission.
- Specified by:
isDeniedByin interfacePermission- Overrides:
isDeniedByin classAbstractPermission- Parameters:
permissions- the configured permission interfaces- Returns:
- true if matches
-
appliesTo
Description copied from interface:PermissionDetermines whether this permission applies to given class or instances of it.- Specified by:
appliesToin interfacePermission- Parameters:
clazz- the class- Returns:
- true if applies
-