Skip to content

Permissions

Jean-Guy Landriault edited this page Jan 4, 2016 · 3 revisions

Permissions

If you have the watchtower.acl.permission.index permission, you will be able to view the permission index list. By default pagination is set to 15 items. Watchtower Configuration will allow you to change that value for permissions.


Create Permission

If you have the watchtower.acl.permission.create permission, when you view the permission index list, you will see a large "Add New Permission" button above the list of permissions.

Clicking that button will bring you to a form to input your new permission. The Name and Slug fields are mandatory while the Description field is optional.

Note The name field is a user-friendly name for your personal reference within your application. It is not used for access control, that is the purpose of the slug field. The slug field, not the name field, is the field that Shinobi validates against.


Show Permission

If you have the watchtower.acl.permission.show permission, when you view the permission index list, you will be able to click on the Name of the permission and be brought to a page that will show you information about that permission, with links to its associated roles or to edit the permission.

NOTE Clicking on the "Roles" link at the bottom of the form, will bring you to the Sync page so you can view and/or modify the roles associated with the permission.


Edit Permission

If you have the watchtower.acl.permission.edit permission, when you view the permission index list, you will see an "Update" button for each permission. (in the following image, the button is coloured grey and is the middle button in the group of three buttons)

Clicking that button will take you to the form to edit the properties of the permission. The Name and Slug fields are mandatory while the Description field is optional.


Destroy Permission

If you have the watchtower.acl.permission.destroy permission, when you view the permission index list, you will see a "Delete" button for each permission. (in the following image, the button is coloured red and is the last in the group of buttons)

If you click that button, you will need to confirm that you want to delete the permission.

NOTE If you confirm and delete the permission, it is gone. There is no going back.


Role Matrix

The role matrix is the most useful of the permission pages provided with Watchtower. It allows you to view and/or modify all your permissions <--> role associations in one big matrix where you can check off the boxes needed to assign multiple permissions to multiple roles all at one time.

Once you have made all the changes necessary, click the big "Save Role Permission Changes" at the bottom of the form and it will update all your roles to have all the selected permissions.

NOTE This is a destructive / constructive database transaction. It will remove all entries in the permission_role pivot table in your database, reset the incremental counter back to 1, then import all of your permission <--> role associations from the matrix form.


Permission Role Sync

If you have the watchtower.acl.permission.role permission, when you view the permission index list, you will see a "Roles" button for each permission. (in the following image, the button is coloured blue and is the first in the group of buttons)

If you click on that button you will be shown which roles currently have that permission assigned to it and all the other roles available to be assigned that permission. Check off the boxes as appropriate and then click the Update button.

💡 Tip If you look closely, you will see there is a count of Available Roles and Current Roles in parenthesis.


Permission Search

If you have the watchtower.acl.permission.search permission, when you view the permission index list, you will see a search box directly below the title with a count of how many records were found.

It will also list any filter used and, if you have performed a search, a link to clear the filter.

Note Searching is not a complicated intensive affair, this is a simple lookup box. This is not a super-duper google style search box. It is a simple string match against the 3 fields (name, slug, description). So a search for "create edit" will only match permissions that have that exact phrase in that order in any of the 3 fields.