In the Role Demo sample, we will create a convenient user interface for managing roles.
You can access the role management page by logging in as
admin@example.comand opening menu Admin -> Manage Roles.
The role management will be implemented inside the RoleController controller living in the
User\Controller namespace. The action methods of the RoleController are listed in table 17.4:
| Action Name | Description |
|---|---|
addAction() |
Allows to add a new role. |
deleteAction() |
Deletes an existing role. |
editAction() |
Allows to edit an existing role. |
editPermissionsAction() |
Allows to assign permissions to a role. |
indexAction() |
Displays the list of existing roles. |
viewAction() |
Displays the details of a role. |
The RoleController works in pair with the RoleManager service which lives in User\Service namespace.
The RoleController and RoleManager contain nothing new and special, so we will skip their
discussion here and will just provide some screenshots of the resulting user interface below.
You can find the complete code of the
RoleControllerandRoleManagerclasses in the Role Demo sample.
Figure 17.5 View details of a role