From 888661a172f1ea975422487219289c131692eeff Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Tue, 24 Sep 2024 16:00:26 +0200 Subject: [PATCH] fix: [permissionLimitiation:getListOfLimitations] Correctly show the correct amount of limitation - Correctly get the number of org permission if the user is an org_group_manager - and one of the org he/she manages doesn't have a user --- src/Model/Table/PermissionLimitationsTable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Table/PermissionLimitationsTable.php b/src/Model/Table/PermissionLimitationsTable.php index b9c74c6..c7fa5ad 100644 --- a/src/Model/Table/PermissionLimitationsTable.php +++ b/src/Model/Table/PermissionLimitationsTable.php @@ -83,8 +83,8 @@ class PermissionLimitationsTable extends AppTable 'scope' => 'user', 'field' => $field, ]; - if (!empty($ownOrgUserIds)) { - $conditions['parent_id IN'] = array_values($ownOrgUserIds); + if ($includeOrganisationPermissions) { + $conditions['parent_id IN'] = !empty($ownOrgUserIds) ? array_values($ownOrgUserIds) : [-1]; } $limitations[$field]['organisation']['current'] = '?'; if ($includeOrganisationPermissions) {