fix perms

This commit is contained in:
Jean-Christian Denis 2023-11-04 18:58:41 +01:00
parent db564e6d21
commit acb524a48d
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951

View file

@ -26,9 +26,8 @@ class My extends MyPlugin
protected static function checkCustomContext(int $context): ?bool protected static function checkCustomContext(int $context): ?bool
{ {
return match ($context) { return match ($context) {
// Allow BACKEND and MANAGE and MENU to also content admin // Add content admin perm to backend
self::BACKEND, self::MANAGE, self::MENU => App::task()->checkContext('BACKEND') self::MANAGE, self::MENU => App::task()->checkContext('BACKEND')
&& App::blog()->isDefined()
&& App::auth()->check(App::auth()->makePermissions([ && App::auth()->check(App::auth()->makePermissions([
App::auth()::PERMISSION_CONTENT_ADMIN, App::auth()::PERMISSION_CONTENT_ADMIN,
]), App::blog()->id()), ]), App::blog()->id()),