Class AccessHelper
java.lang.Object
org.bedework.webdav.servlet.access.AccessHelper
- All Implemented Interfaces:
Serializable,org.bedework.access.PrivilegeDefs,org.bedework.util.logging.Logged,AccessHelperI
An access helper class. This class makes some assumptions about the
classes it deals with but there are no explicit hibernate, or other
persistence engine, dependencies.
It assumes access to the parent object when needed, continuing on up to the root. For systems which do not allow for a retrieval of the parent on calls to the getCalendar method, the getParent method for this class will need to be overridden. This would presumably take place within the core implementation.
- Author:
- Mike Douglass
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bedework.webdav.servlet.access.AccessHelperI
AccessHelperI.CallBack -
Field Summary
Fields inherited from interface org.bedework.access.PrivilegeDefs
allowed, allowedInherited, denied, deniedInherited, inheritedFlag, oldAllowed, oldDenied, privAll, privAny, privBind, privEncoding, privMaxType, privNone, privRead, privReadAcl, privReadCurrentUserPrivilegeSet, privReadFreeBusy, privSchedule, privScheduleDeliver, privScheduleDeliverInvite, privScheduleDeliverReply, privScheduleFreeBusy, privScheduleQueryFreebusy, privScheduleReply, privScheduleRequest, privScheduleSend, privScheduleSendFreebusy, privScheduleSendInvite, privScheduleSendReply, privUnbind, privUnlock, privWrite, privWriteAcl, privWriteContent, privWriteProperties, unspecified -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeAccess(SharedEntity ent, Collection<org.bedework.access.Ace> aces, boolean replaceAll) Change the access to the given calendar entity using the supplied aces.Collection<? extends SharedEntity>checkAccess(Collection<? extends SharedEntity> ents, int desiredAccess, boolean alwaysReturn) Return a Collection of the objects after checking accessorg.bedework.access.CurrentAccesscheckAccess(SharedEntity ent, int desiredAccess, boolean alwaysReturnResult) Check access for the given entity.voidclose()Called at request endvoiddefaultAccess(SharedEntity ent, org.bedework.access.AceWho who) Remove any explicit access for the given who to the given calendar entity.Get the default public accessorg.bedework.util.logging.BwLoggergetParent(SharedEntity val) Called to get the parent object for a shared entity.booleanvoidvoidopen()Called at request startvoidsetAuthPrincipal(org.bedework.access.AccessPrincipal val) Set the current authenticated user.voidsetMaximumAllowedPrivs(org.bedework.access.PrivilegeSet val) voidsetSuperUser(boolean val) Indicate if we are in superuser mode.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, trace, warn
-
Constructor Details
-
AccessHelper
public AccessHelper()
-
-
Method Details
-
init
- Specified by:
initin interfaceAccessHelperI- Parameters:
cb- callback
-
setSuperUser
public void setSuperUser(boolean val) Description copied from interface:AccessHelperIIndicate if we are in superuser mode.- Specified by:
setSuperUserin interfaceAccessHelperI- Parameters:
val- true for superuser
-
getSuperUser
public boolean getSuperUser()- Specified by:
getSuperUserin interfaceAccessHelperI- Returns:
- boolean
-
setMaximumAllowedPrivs
public void setMaximumAllowedPrivs(org.bedework.access.PrivilegeSet val) - Parameters:
val- priv set
-
setAuthPrincipal
public void setAuthPrincipal(org.bedework.access.AccessPrincipal val) Description copied from interface:AccessHelperISet the current authenticated user.- Specified by:
setAuthPrincipalin interfaceAccessHelperI- Parameters:
val- principal
-
open
public void open()Description copied from interface:AccessHelperICalled at request start- Specified by:
openin interfaceAccessHelperI
-
close
public void close()Description copied from interface:AccessHelperICalled at request end- Specified by:
closein interfaceAccessHelperI
-
getDefaultPublicAccess
Description copied from interface:AccessHelperIGet the default public access- Specified by:
getDefaultPublicAccessin interfaceAccessHelperI- Returns:
- String value for default access
-
getDefaultPersonalAccess
- Specified by:
getDefaultPersonalAccessin interfaceAccessHelperI- Returns:
- String default user access
-
checkAccess
public Collection<? extends SharedEntity> checkAccess(Collection<? extends SharedEntity> ents, int desiredAccess, boolean alwaysReturn) Description copied from interface:AccessHelperIReturn a Collection of the objects after checking access- Specified by:
checkAccessin interfaceAccessHelperI- Parameters:
ents- Collection of DbEntitydesiredAccess- access we wantalwaysReturn- boolean flag behaviour on no access- Returns:
- Collection of checked objects
-
getLogger
public org.bedework.util.logging.BwLogger getLogger()- Specified by:
getLoggerin interfaceorg.bedework.util.logging.Logged
-