class PermissionTemplateWriteService (View source)

The single guarded entry point for permission template writes.

Every web and API create/update path goes through here, so the content rule cannot be skipped by adding another controller.

Methods

__construct(DbPermissionTemplateRepository $templateRepository, UserRepository $userRepository)

No description

array
create(int $callerId, array $details)

No description

array
update(int $callerId, int $templateId, array $details)

No description

bool
callerMaySetSuperuser(int $callerId)

Whether the caller may be offered the superuser permission in a template picker.

Details

__construct(DbPermissionTemplateRepository $templateRepository, UserRepository $userRepository)

No description

Parameters

DbPermissionTemplateRepository $templateRepository
UserRepository $userRepository

array create(int $callerId, array $details)

No description

Parameters

int $callerId
array $details

Repository payload: templ_name, templ_descr, template_type, perm_id

Return Value

array

array update(int $callerId, int $templateId, array $details)

No description

Parameters

int $callerId
int $templateId
array $details

Repository payload; templ_id is forced to $templateId

Return Value

array

bool callerMaySetSuperuser(int $callerId)

Whether the caller may be offered the superuser permission in a template picker.

Parameters

int $callerId

Return Value

bool