diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index 6493f3a2a0..1708591783 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -181,9 +181,9 @@ class calendar_bo /** * Does a user require an extra invite grant, to be able to invite an other user, default no * - * @var boolean + * @var string 'all', 'groups' or null */ - public $require_acl_invite = false; + public $require_acl_invite = null; /** * if the number of selected users for a view exeeds this number a view is consolidated (5 is set as default) diff --git a/calendar/inc/class.calendar_groupdav.inc.php b/calendar/inc/class.calendar_groupdav.inc.php index 668490d14a..3255f33329 100644 --- a/calendar/inc/class.calendar_groupdav.inc.php +++ b/calendar/inc/class.calendar_groupdav.inc.php @@ -1126,6 +1126,14 @@ class calendar_groupdav extends groupdav_handler { $privileges['schedule-deliver'] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV, 'schedule-deliver', ''); } + // remove bind privilege on other users or groups calendars, if calendar config require_acl_invite is set + // and current user has no invite grant + if ($user && $user != $GLOBALS['egw_info']['user']['account_id'] && isset($privileges['bind']) && + ($this->bo->require_acl_invite == 'all' || $this->bo->require_acl_invite == 'groups' && $user < 0) && + !$this->bo->check_perms(EGW_ACL_INVITE, 0, $user)) + { + unset($privileges['bind']); + } //error_log(__METHOD__."('$path', $user) returning ".array2string($privileges)); return $privileges; }