Allow disabling calendar invitations of resources

This commit is contained in:
Marcel Klehr 2018-03-19 16:58:44 +01:00
parent 810a90af56
commit fb6cfee24c
2 changed files with 22 additions and 3 deletions

View File

@ -507,9 +507,18 @@ class calendar_boupdate extends calendar_bo
*/
public function check_acl_invite($uid)
{
if (!is_numeric($uid)) return true; // nothing implemented for resources so far
if (!$this->require_acl_invite)
if (!is_numeric($uid))
{
$resources_config = Api\Config::read('resources');
if ($resources_config['bookingrequests'] === 'disabled') {
$ret = $this->check_perms(resources_acl_bo::DIRECT_BOOKING, 0, $uid);
}
else
{
$ret = true;
}
}
elseif (!$this->require_acl_invite)
{
$ret = true; // no grant required
}

View File

@ -17,6 +17,16 @@
<option value="no">No</option>
</select>
</row>
<row>
<description value="Booking requests" span="all" class="subHeader"/>
</row>
<row>
<description value="Allow booking requests from any user when creating events?"/>
<select id="newsettings[bookingrequests]">
<option value="disabled">No, users will need to contact users with direct booking permission</option>
<option value="">Yes</option>
</select>
</row>
<row>
<description value="History logging" span="all" class="subHeader"/>
</row>