From c08120c9d0b2cb06ebcbff009eacc5dbc6dfbea4 Mon Sep 17 00:00:00 2001 From: aleklundeq <138589813+aleklundeq@users.noreply.github.com> Date: Thu, 14 Sep 2023 11:59:02 +0200 Subject: [PATCH] Fix: Change placement of checking ResourceRead (#589) --- .../Controllers/Requests/InternalRequestsController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/api/Fusion.Resources.Api/Controllers/Requests/InternalRequestsController.cs b/src/backend/api/Fusion.Resources.Api/Controllers/Requests/InternalRequestsController.cs index 05f26273d..51bd0bc85 100644 --- a/src/backend/api/Fusion.Resources.Api/Controllers/Requests/InternalRequestsController.cs +++ b/src/backend/api/Fusion.Resources.Api/Controllers/Requests/InternalRequestsController.cs @@ -486,6 +486,8 @@ public async Task>> Get r.AnyOf(or => { + or.ResourcesRead(); + if (!query.HasFilter) return; var filter = query.Filter.GetFilterForField("assignedDepartment"); @@ -501,7 +503,6 @@ public async Task>> Get ); or.HaveOrgUnitScopedRole(DepartmentId.FromFullPath(departmentString), AccessRoles.ResourceOwner); } - or.ResourcesRead(); }); });