From 4176b598ce8c61b284bcdbb1cb0c05b3a0951c70 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sun, 19 Feb 2023 16:03:50 +0000 Subject: [PATCH] Fixed unselectable checkbox role form options --- app/Http/Controllers/RoleController.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php index 2bf0a7b19..135ba329f 100644 --- a/app/Http/Controllers/RoleController.php +++ b/app/Http/Controllers/RoleController.php @@ -116,14 +116,8 @@ class RoleController extends Controller 'mfa_enforced' => ['string'], ]); - if (isset($data['permissions'])) { - $data['permissions'] = array_keys($data['permissions']); - } - - if (isset($data['mfa_enforced'])) { - $data['mfa_enforced'] = $data['mfa_enforced'] === 'true'; - } - + $data['permissions'] = array_keys($data['permissions'] ?? []); + $data['mfa_enforced'] = ($data['mfa_enforced'] ?? 'false') === 'true'; $this->permissionsRepo->updateRole($id, $data); return redirect('/settings/roles');