Merge pull request #38 from marcelklehr/feature/disable-cal-invitations-for-resources

Allow disabling calendar invitations to resources
This commit is contained in:
Nathan Gray 2018-04-03 10:07:29 -06:00 committed by GitHub
commit 470b989672
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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>