From 11f98ba2724cb4e865b1ffce7c313f259a9fa67d Mon Sep 17 00:00:00 2001 From: Tobias Frauenfelder Date: Wed, 10 Apr 2024 22:14:08 +0200 Subject: [PATCH] Allow people with the role "Leitung" in a "Ehemalige" group to login as unitleader --- api/app/Http/Controllers/AuthController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/app/Http/Controllers/AuthController.php b/api/app/Http/Controllers/AuthController.php index a91b2bc..c33a795 100644 --- a/api/app/Http/Controllers/AuthController.php +++ b/api/app/Http/Controllers/AuthController.php @@ -42,7 +42,10 @@ public function handleProviderCallback(Request $request) $user->assignRole('admin'); } elseif ($midata_group_ids = $this->hasRole($midataUser->user, 'Einheitsleiter*in', $groupIds)) { $user->assignRole('unitleader'); - } + } elseif ($midata_group_ids = $this->hasRole($midataUser->user, 'Leitung', $groupIds)) { + $user->assignRole('unitleader'); + } + $groups = Group::whereIn('midata_id', $midata_group_ids)->get(); $user->groups()->sync($groups);