chg: [permission limitations] free limitation count when user disabled
- Thanks to Elisabeth from BSI for reporting itpull/184/head
parent
2655241265
commit
8ded51f733
|
@ -37,7 +37,8 @@ class PermissionLimitationsTable extends AppTable
|
||||||
'keyField' => 'id',
|
'keyField' => 'id',
|
||||||
'valueField' => 'id',
|
'valueField' => 'id',
|
||||||
'conditions' => [
|
'conditions' => [
|
||||||
'organisation_id' => $data['organisation_id']
|
'organisation_id' => $data['organisation_id'],
|
||||||
|
'disabled' => false
|
||||||
]
|
]
|
||||||
])->all()->toList();
|
])->all()->toList();
|
||||||
}
|
}
|
||||||
|
@ -58,11 +59,19 @@ class PermissionLimitationsTable extends AppTable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($limitations as $field => $data) {
|
foreach ($limitations as $field => $data) {
|
||||||
|
$disabledUserIds = $Users->find('list', [
|
||||||
|
'keyField' => 'id',
|
||||||
|
'valueField' => 'id',
|
||||||
|
'conditions' => [
|
||||||
|
'disabled' => true
|
||||||
|
]
|
||||||
|
])->all()->toList();
|
||||||
if (isset($data['global'])) {
|
if (isset($data['global'])) {
|
||||||
$limitations[$field]['global']['current'] = $MetaFields->find('all', [
|
$limitations[$field]['global']['current'] = $MetaFields->find('all', [
|
||||||
'conditions' => [
|
'conditions' => [
|
||||||
'scope' => 'user',
|
'scope' => 'user',
|
||||||
'field' => $field
|
'field' => $field,
|
||||||
|
'parent_id NOT IN' => $disabledUserIds
|
||||||
]
|
]
|
||||||
])->count();
|
])->count();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue