From ea9c09867497fe20e964f9192d54a3d5501c3f82 Mon Sep 17 00:00:00 2001 From: Moritz Strohm <strohm@data-quest.de> Date: Wed, 13 Sep 2023 08:33:25 +0000 Subject: [PATCH] allow users with room permissions to use the export tab in the resource management, re #1725 Merge request studip/studip!2023 --- app/controllers/resources/export.php | 5 ++++- lib/navigation/ResourceNavigation.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/resources/export.php b/app/controllers/resources/export.php index 1541ede56b4..a891af2bcfb 100644 --- a/app/controllers/resources/export.php +++ b/app/controllers/resources/export.php @@ -58,7 +58,10 @@ class Resources_ExportController extends AuthenticatedController if (Navigation::hasItem('/resources/export/select_booking_sources')) { Navigation::activateItem('/resources/export/select_booking_sources'); } - if (!ResourceManager::userHasGlobalPermission(User::findCurrent())) { + if ( + !ResourceManager::userHasGlobalPermission(User::findCurrent()) + && !ResourceManager::userHasResourcePermissions(User::findCurrent(), 'user') + ) { throw new AccessDeniedException(); } diff --git a/lib/navigation/ResourceNavigation.php b/lib/navigation/ResourceNavigation.php index a22927061fd..b2e3a8a66ee 100644 --- a/lib/navigation/ResourceNavigation.php +++ b/lib/navigation/ResourceNavigation.php @@ -210,7 +210,7 @@ class ResourceNavigation extends Navigation $this->addSubNavigation('structure', $sub_navigation); } - if ($user_is_global_resource_user) { + if ($user_has_rooms || $user_is_global_resource_user) { //Export tab: $export_navigation = new Navigation( _('Export'), -- GitLab