From c82e3183d682eb52f21acef43a2dc306b7ab2653 Mon Sep 17 00:00:00 2001 From: Xu Date: Tue, 21 May 2024 19:22:00 +0200 Subject: [PATCH] fix shifttypes permission --- includes/sys_menu.php | 2 +- includes/view/Shifts_view.php | 2 +- src/Controllers/Admin/ShiftTypesController.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/sys_menu.php b/includes/sys_menu.php index a93f9aff..4ea21c88 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -90,7 +90,7 @@ function make_navigation() 'users' => ['All Angels', 'admin_user'], 'admin_free' => 'Free angels', 'admin/questions' => ['Answer questions', 'question.edit'], - 'admin/shifttypes' => ['shifttype.shifttypes', 'shifttypes'], + 'admin/shifttypes' => ['shifttype.shifttypes', 'shifttypes.view'], 'admin_shifts' => 'Create shifts', 'admin/locations' => ['location.locations', 'admin_locations'], 'admin_groups' => 'Grouprights', diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php index 19f5dd7d..a5adbbbc 100644 --- a/includes/view/Shifts_view.php +++ b/includes/view/Shifts_view.php @@ -155,7 +155,7 @@ function Shift_view( $shift_admin = auth()->can('admin_shifts'); $user_shift_admin = auth()->can('user_shifts_admin'); $admin_locations = auth()->can('admin_locations'); - $admin_shifttypes = auth()->can('shifttypes'); + $admin_shifttypes = auth()->can('shifttypes.view'); $nightShiftsConfig = config('night_shifts'); $goodie = GoodieType::from(config('goodie_type')); $goodie_enabled = $goodie !== GoodieType::None; diff --git a/src/Controllers/Admin/ShiftTypesController.php b/src/Controllers/Admin/ShiftTypesController.php index 67ee731c..a8988144 100644 --- a/src/Controllers/Admin/ShiftTypesController.php +++ b/src/Controllers/Admin/ShiftTypesController.php @@ -23,7 +23,7 @@ class ShiftTypesController extends BaseController /** @var array */ protected array $permissions = [ - 'shifttypes', + 'shifttypes.view', 'edit' => 'shifttypes.edit', 'delete' => 'shifttypes.edit', 'save' => 'shifttypes.edit',