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