maybe better permissions check

master
Jean-Christian Paul Denis 2023-10-21 22:45:58 +02:00
parent 12481455ca
commit d63eaeb95a
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
1 changed files with 5 additions and 1 deletions

View File

@ -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,
};
}
/**