public class AccessHelper extends Object implements AccessHelperI
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.
AccessHelperI.CallBackallowed, 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 and Description |
|---|
AccessHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
changeAccess(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 access
|
org.bedework.access.Acl.CurrentAccess |
checkAccess(SharedEntity ent,
int desiredAccess,
boolean alwaysReturnResult)
Check access for the given entity.
|
void |
close()
Called at request end
|
void |
defaultAccess(SharedEntity ent,
org.bedework.access.AceWho who)
Remove any explicit access for the given who to the given calendar entity.
|
String |
getDefaultPersonalAccess() |
String |
getDefaultPublicAccess()
Get the default public access
|
SharedEntity |
getParent(SharedEntity val)
Called to get the parent object for a shared entity.
|
boolean |
getSuperUser() |
void |
init(AccessHelperI.CallBack cb) |
void |
open()
Called at request start
|
void |
setAuthPrincipal(org.bedework.access.AccessPrincipal val)
Set the current authenticated user.
|
void |
setMaximumAllowedPrivs(org.bedework.access.PrivilegeSet val) |
void |
setSuperUser(boolean val)
Indicate if we are in superuser mode.
|
public void init(AccessHelperI.CallBack cb) throws WebdavException
init in interface AccessHelperIcb - callbackWebdavException - on errorpublic void setSuperUser(boolean val)
AccessHelperIsetSuperUser in interface AccessHelperIval - true for superuserpublic boolean getSuperUser()
getSuperUser in interface AccessHelperIpublic void setMaximumAllowedPrivs(org.bedework.access.PrivilegeSet val)
val - priv setpublic void setAuthPrincipal(org.bedework.access.AccessPrincipal val)
AccessHelperIsetAuthPrincipal in interface AccessHelperIval - principalpublic void open()
AccessHelperIopen in interface AccessHelperIpublic void close()
AccessHelperIclose in interface AccessHelperIpublic SharedEntity getParent(SharedEntity val) throws WebdavException
AccessHelperIgetParent in interface AccessHelperIval - entityWebdavException - on errorpublic String getDefaultPublicAccess()
AccessHelperIgetDefaultPublicAccess in interface AccessHelperIpublic String getDefaultPersonalAccess()
getDefaultPersonalAccess in interface AccessHelperIpublic void changeAccess(SharedEntity ent, Collection<org.bedework.access.Ace> aces, boolean replaceAll) throws WebdavException
AccessHelperIchangeAccess in interface AccessHelperIent - DbEntityaces - Collection of ace objectsreplaceAll - true to replace the entire access list.WebdavException - on errorpublic void defaultAccess(SharedEntity ent, org.bedework.access.AceWho who) throws WebdavException
AccessHelperIdefaultAccess in interface AccessHelperIent - DbEntitywho - AceWhoWebdavException - on errorpublic Collection<? extends SharedEntity> checkAccess(Collection<? extends SharedEntity> ents, int desiredAccess, boolean alwaysReturn) throws WebdavException
AccessHelperIcheckAccess in interface AccessHelperIents - Collection of DbEntitydesiredAccess - access we wantalwaysReturn - boolean flag behaviour on no accessWebdavException - for no access or other failurepublic org.bedework.access.Acl.CurrentAccess checkAccess(SharedEntity ent, int desiredAccess, boolean alwaysReturnResult) throws WebdavException
AccessHelperIWe special case the access to the user root e.g /user and the home directory, e.g. /user/douglm We deny access to /user to anybody without superuser access. This prevents user browsing. This could be made a system property if the organization wants user browsing. Default access to the home directory is read, write-content to the owner only and unlimited to superuser. Specific access should be no more than read, write-content to the home directory.
checkAccess in interface AccessHelperIent - shred entitydesiredAccess - accessalwaysReturnResult - true to return alwaysWebdavException - on errorCopyright © 2018 Bedework. All rights reserved.