From f739e457e4ee4cca11b16e75e9110cc63750805c Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Sat, 14 Oct 2017 21:55:56 -0600 Subject: [PATCH] Enable superusers to actually use the is_superuser filter --- modules/backend/controllers/Users.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/backend/controllers/Users.php b/modules/backend/controllers/Users.php index ddc4c2961..2da15ea2d 100644 --- a/modules/backend/controllers/Users.php +++ b/modules/backend/controllers/Users.php @@ -49,10 +49,13 @@ class Users extends Controller */ public function __construct() { - // Prevent non-superusers from even seeing the is_superuser filter - $this->listConfig = $this->makeConfig($this->listConfig); - $this->listConfig->filter = $this->makeConfig($this->listConfig->filter); - unset($this->listConfig->filter->scopes['is_superuser']); + $this->user = BackendAuth::getUser(); + if (!$this->user->isSuperUser()) { + // Prevent non-superusers from even seeing the is_superuser filter + $this->listConfig = $this->makeConfig($this->listConfig); + $this->listConfig->filter = $this->makeConfig($this->listConfig->filter); + unset($this->listConfig->filter->scopes['is_superuser']); + } parent::__construct();