From d63eaeb95ad1c5cc2b9a716a98972fd06a345b1e Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 21 Oct 2023 22:45:58 +0200 Subject: [PATCH] maybe better permissions check --- src/My.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/My.php b/src/My.php index 5167b7c..8c54c89 100644 --- a/src/My.php +++ b/src/My.php @@ -25,7 +25,11 @@ class My extends MyPlugin public static function checkCustomContext(int $context): ?bool { - return in_array($context, [My::BACKEND, My::MANAGE, My::MENU]) ? App::auth()->isSuperAdmin() : null; + // Limit to super admin + return match($context) { + self::MODULE => App::auth()->isSuperAdmin(), + default => null, + }; } /**