fix: [OrgGroups:checkIfGroupAdmin] Consider site_admins as group admin
parent
44527bbcb8
commit
b2df8192f7
|
@ -175,8 +175,8 @@ class ACLComponent extends Component
|
|||
'listOrgs' => ['*'],
|
||||
'assignAdmin' => ['perm_admin'],
|
||||
'removeAdmin' => ['perm_admin'],
|
||||
'attachOrg' => ['perm_group_admin'],
|
||||
'detachOrg' => ['perm_group_admin']
|
||||
'attachOrg' => ['perm_admin', 'perm_group_admin'],
|
||||
'detachOrg' => ['perm_admin', 'perm_group_admin']
|
||||
],
|
||||
'Organisations' => [
|
||||
'add' => ['perm_admin'],
|
||||
|
|
|
@ -37,6 +37,9 @@ class OrgGroupsTable extends AppTable
|
|||
|
||||
public function checkIfGroupAdmin(int $groupId, User $user): bool
|
||||
{
|
||||
if (!empty($user['role']['perm_admin'])) {
|
||||
return true;
|
||||
}
|
||||
$orgGroup = $this->get($groupId, ['contain' => 'Users']);
|
||||
if (empty($orgGroup)) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue