fix: [permissionlimitation:getLimitations] Mirror the permission limit if only one scope (global or org) is defined
parent
31ce0feed8
commit
9a2e94989f
|
@ -45,6 +45,14 @@ class PermissionLimitationsTable extends AppTable
|
|||
'limit' => $entry['max_occurrence']
|
||||
];
|
||||
}
|
||||
foreach ($limitations as $i => $permissions) { // Make sure global and organisations permission are mirror in the case where one of the two is not defined
|
||||
if (!isset($permissions['global']['limit'])) {
|
||||
$limitations[$i]['global']['limit'] = $permissions['organisation']['limit'];
|
||||
}
|
||||
if (!isset($permissions['organisation']['limit'])) {
|
||||
$limitations[$i]['organisation']['limit'] = $permissions['global']['limit'];
|
||||
}
|
||||
}
|
||||
foreach ($limitations as $field => $data) {
|
||||
if (isset($data['global'])) {
|
||||
$limitations[$field]['global']['current'] = $MetaFields->find('all', [
|
||||
|
|
Loading…
Reference in New Issue