maybe better permissions check

This commit is contained in:
Jean-Christian Denis 2023-10-21 22:45:58 +02:00
parent 12481455ca
commit d63eaeb95a
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951

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