diff --git a/_define.php b/_define.php index 24181b4..97a663c 100644 --- a/_define.php +++ b/_define.php @@ -19,10 +19,11 @@ $this->registerModule( 'Jean-Christian Denis', '2023.10.19', [ - 'requires' => [['core', '2.28']], - 'type' => 'plugin', - 'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues', - 'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md', - 'repository' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/raw/branch/master/dcstore.xml', + 'requires' => [['core', '2.28']], + 'permissions' => 'My', + 'type' => 'plugin', + 'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues', + 'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md', + 'repository' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/raw/branch/master/dcstore.xml', ] ); diff --git a/src/My.php b/src/My.php index ff24bb9..39ba9f3 100644 --- a/src/My.php +++ b/src/My.php @@ -36,7 +36,10 @@ class My extends MyPlugin public static function checkCustomContext(int $context): ?bool { - // Only backend and super admin - return $context === self::INSTALL ? null : App::task()->checkContext('BACKEND') && App::auth()->isSuperAdmin(); + // Limit to super admin + return match ($context) { + self::MODULE => App::auth()->isSuperAdmin(), + default => null, + }; } }