CoolCMS API

UserRoleFormTrait

Add/edit form of a user role (RBAC v2 columns included).

Fields: name, setAfterRegistration, code/assignable/implicit/conditional/ privileged/protectLastHolder. The privileges M2M is deliberately not edited here: the role x privilege matrix is managed per group (PrivilegeGroupPresenter).

IMPORTANT: code is read-only after creation. Renaming it would switch off the resolver, because the RBAC seed is bound to code. It is editable only on add; on edit it is setDisabled() (framework-level readonly: the POST value is ignored and the disabled control is left out of getValues(), so the role keeps the code loaded from the DB).

Table of Contents

Methods

createComponentEditForm()  : Form
saveUserRoleForm()  : bool
setUserRoleFormDefaults()  : void

Methods

saveUserRoleForm()

private saveUserRoleForm(ArrayHash<string|int, mixed> $values) : bool
Parameters
$values : ArrayHash<string|int, mixed>
Return values
bool
On this page

Search results