From ea078f28fccc375ea7d3315404f9263d92bad8d5 Mon Sep 17 00:00:00 2001 From: Ian Morland Date: Tue, 11 Oct 2022 08:20:38 +0100 Subject: [PATCH] fix: prevent auto assigning groups to admin users --- src/Jobs/AutoAssignUserGroups.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Jobs/AutoAssignUserGroups.php b/src/Jobs/AutoAssignUserGroups.php index 86bb8e6..5897671 100644 --- a/src/Jobs/AutoAssignUserGroups.php +++ b/src/Jobs/AutoAssignUserGroups.php @@ -41,7 +41,8 @@ public function handle(SettingsRepositoryInterface $settings, Dispatcher $dispat { $entries = json_decode($settings->get('fof-gamification.autoAssignedGroups'), true); - if (!is_array($entries)) { + // If there are no entries, or if the subject user is an admin, we can skip this job + if (!is_array($entries) || $this->user->isAdmin()) { return; }