PermissionTemplateContentGuard
class PermissionTemplateContentGuard (View source)
Gates what a permission template may contain.
templ_perm_add/templ_perm_edit delegate template management, but a template's
permission list is itself an authority grant: ticking user_is_ueberuser on the
template you are already assigned to makes you a superuser without any assignment
step, which would bypass PermissionTemplateAssignmentGuard entirely. So a caller who
is not already a superuser may neither put that permission into a template nor touch
a template that already carries it - the latter also stops them stripping the
Administrator template bare to lock real admins out.
Constants
| UBERUSER_PERMISSION |
|
| CONTENT_SUPERUSER_DENIED |
|
| EDIT_SUPERUSER_DENIED |
|
Methods
Apply the rule to a template create or update.
Drop the superuser permission from a picker list shown to a non-superuser.
Details
static string|null
apply(UserRepository $userRepository, int $callerId, int|null $templateId, array|null $permIds)
Apply the rule to a template create or update.
static array
filterOfferedPermissions(array $permissions, bool $callerIsSuperuser)
Drop the superuser permission from a picker list shown to a non-superuser.