maybe better permissions check
parent
b360dc199f
commit
f2a5aa0179
|
@ -20,6 +20,7 @@ $this->registerModule(
|
|||
'2023.10.19',
|
||||
[
|
||||
'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',
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue