maybe better permissions check
This commit is contained in:
parent
b360dc199f
commit
f2a5aa0179
11
_define.php
11
_define.php
@ -19,10 +19,11 @@ $this->registerModule(
|
|||||||
'Jean-Christian Denis',
|
'Jean-Christian Denis',
|
||||||
'2023.10.19',
|
'2023.10.19',
|
||||||
[
|
[
|
||||||
'requires' => [['core', '2.28']],
|
'requires' => [['core', '2.28']],
|
||||||
'type' => 'plugin',
|
'permissions' => 'My',
|
||||||
'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues',
|
'type' => 'plugin',
|
||||||
'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md',
|
'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues',
|
||||||
'repository' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/raw/branch/master/dcstore.xml',
|
'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',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -36,7 +36,10 @@ class My extends MyPlugin
|
|||||||
|
|
||||||
public static function checkCustomContext(int $context): ?bool
|
public static function checkCustomContext(int $context): ?bool
|
||||||
{
|
{
|
||||||
// Only backend and super admin
|
// Limit to super admin
|
||||||
return $context === self::INSTALL ? null : App::task()->checkContext('BACKEND') && App::auth()->isSuperAdmin();
|
return match ($context) {
|
||||||
|
self::MODULE => App::auth()->isSuperAdmin(),
|
||||||
|
default => null,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user