In the Role Demo sample, we will create a convenient user interface for managing permissions. It will be useful if you plan to add new permissions or remove existing ones.
You can access the permission management page by logging in as
admin@example.com
and opening menu Admin -> Manage Permissions.
The permission management will be implemented inside the PermissionController
controller living in the
User\Controller
namespace. The action methods of the PermissionController
are listed in table 17.5:
Action Name | Description |
---|---|
addAction() |
Allows to add a new permission. |
deleteAction() |
Deletes an existing permission. |
editAction() |
Allows to edit an existing permission. |
indexAction() |
Displays the list of existing permissions. |
viewAction() |
Displays the details of a permission. |
The PermissionController
works in pair with the PermissionManager
service which
lives in User\Service
namespace.
The PermissionController
and PermissionManager
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
PermissionController
andPermissionManager
classes in the Role Demo sample.