Package org.cyclos.impl.access
Class BasePermissionCheckImpl
- java.lang.Object
-
- org.cyclos.impl.access.BasePermissionCheckImpl
-
- All Implemented Interfaces:
PermissionCheck
- Direct Known Subclasses:
GeneralPermissionCheckImpl,UserPermissionCheckImpl
public abstract class BasePermissionCheckImpl extends Object implements PermissionCheck
Base implementation for permission checks
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthHandlerauthHandlerprotected SessionDatasessionData
-
Constructor Summary
Constructors Constructor Description BasePermissionCheckImpl(boolean optionalValue, AuthHandler authHandler, SessionData sessionData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheck()IfPermissionCheck.granted()returns false, throwsPermissionDeniedException.protected booleanhasAnyPermission(Permission... permissions)Checks whether any of the give permissions are grantedprotected booleanhasPermission(Permission permission)Checks not only the given permission, but also required values (if any)PermissionCheckvalue(Object value)Determines the value to be checked if the corresponding permission requires value checksPermissionCheckvalues(Collection<?> values)Determines the values to be checked if the corresponding permission requires value checks-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.impl.access.PermissionCheck
granted
-
-
-
-
Field Detail
-
authHandler
protected final AuthHandler authHandler
-
sessionData
protected final SessionData sessionData
-
-
Constructor Detail
-
BasePermissionCheckImpl
public BasePermissionCheckImpl(boolean optionalValue, AuthHandler authHandler, SessionData sessionData)
-
-
Method Detail
-
check
public void check() throws PermissionDeniedExceptionDescription copied from interface:PermissionCheckIfPermissionCheck.granted()returns false, throwsPermissionDeniedException. Otherwise, returns silently.- Specified by:
checkin interfacePermissionCheck- Throws:
PermissionDeniedException
-
value
public PermissionCheck value(Object value)
Description copied from interface:PermissionCheckDetermines the value to be checked if the corresponding permission requires value checks- Specified by:
valuein interfacePermissionCheck
-
values
public PermissionCheck values(Collection<?> values)
Description copied from interface:PermissionCheckDetermines the values to be checked if the corresponding permission requires value checks- Specified by:
valuesin interfacePermissionCheck
-
hasAnyPermission
protected boolean hasAnyPermission(Permission... permissions)
Checks whether any of the give permissions are granted- See Also:
hasPermission(Permission)
-
hasPermission
protected boolean hasPermission(Permission permission)
Checks not only the given permission, but also required values (if any)
-
-