Commit 3b094db3 authored by Clare Lenihan's avatar Clare Lenihan Committed by Clare Lenihan
Browse files

changing user_can_access_group() so it sets membership as including tutor if...

changing user_can_access_group() so it sets membership as including tutor if the user is the group owner/staff/admin
parent 511a695e
...@@ -282,15 +282,15 @@ function user_can_access_group($group, $user=null) { ...@@ -282,15 +282,15 @@ function user_can_access_group($group, $user=null) {
} }
$membertypes = 0; $membertypes = 0;
// admins/staff/owners can do whatever tutors can do
if ($user->get('admin')) { if ($user->get('admin')) {
$membertypes = GROUP_MEMBERSHIP_ADMIN; $membertypes = GROUP_MEMBERSHIP_ADMIN | GROUP_MEMBERSHIP_TUTOR;
} }
if ($user->get('staff') || $user->is_institutional_admin() || $user->is_institutional_staff()) { if ($user->get('staff') || $user->is_institutional_admin() || $user->is_institutional_staff()) {
$membertypes = $membertypes | GROUP_MEMBERSHIP_STAFF; $membertypes = $membertypes | GROUP_MEMBERSHIP_STAFF | GROUP_MEMBERSHIP_TUTOR;
} }
if ($group->owner == $user->get('id')) { if ($group->owner == $user->get('id')) {
$membertypes = $membertypes | GROUP_MEMBERSHIP_OWNER; $membertypes = $membertypes | GROUP_MEMBERSHIP_OWNER | GROUP_MEMBERSHIP_TUTOR;
} }
if (!$membership = get_record('group_member', 'group', $group->id, 'member', $user->get('id'))) { if (!$membership = get_record('group_member', 'group', $group->id, 'member', $user->get('id'))) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment