fix: [permissionLimitations] Prevent error for org without users
parent
2a754160ef
commit
d9df6ed4c3
|
@ -63,12 +63,15 @@ class PermissionLimitationsTable extends AppTable
|
||||||
])->count();
|
])->count();
|
||||||
}
|
}
|
||||||
if (isset($data['global'])) {
|
if (isset($data['global'])) {
|
||||||
$limitations[$field]['organisation']['current'] = $MetaFields->find('all', [
|
$conditions = [
|
||||||
'conditions' => [
|
|
||||||
'scope' => 'user',
|
'scope' => 'user',
|
||||||
'field' => $field,
|
'field' => $field,
|
||||||
'parent_id IN' => array_values($ownOrgUserIds)
|
];
|
||||||
]
|
if (!empty($ownOrgUserIds)) {
|
||||||
|
$conditions['parent_id IN'] = array_values($ownOrgUserIds);
|
||||||
|
}
|
||||||
|
$limitations[$field]['organisation']['current'] = $MetaFields->find('all', [
|
||||||
|
'conditions' => $conditions,
|
||||||
])->count();
|
])->count();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue