Roles & Permissions
Since the application serves purpose for the DUCS office, there are tasks that overlap interaction and supervision from multiple people. As such, there's no clear divide of responsibility for all resources.
Consider, an example of letter logs. While the office staff creates an entry for a letter, at times the responsibility of overlooking it lies with the intended recepient/sender. Remarks are exchanged in such cases. Moreover, nobody except the creator of the letter entry is allowed to delete or modify it.
This phenomenon is seen throughout most requirements of DUCS.
To provide this flexibility in the application we have used a third party package Larevel-Permission by spatie.
The documentation's first line says
This package allows you to manage user permissions and roles in a database.
Roles here serve the purpose of grouping users into categories that define and limit their interaction with the application on multiple resources. This is controlled by giving a set of permissions to a role.
Most resources have CRUD permissions on them, and a few are based on DUCS' requirements. We were made aware of all actions on a resource/feature during the course of development. Therefore, we chose to create these permissions statically. Find the list here. When a new role is created, any subset from the list of permissions can be allowed on it, as defined by the use-case.
Now, a user can be given a role with the permission of creating letters named office staff
and another user can be given a role with permission to view all letters and also leave remarks on them named faculty
, thus, leaving customisation into the hands of the admin.
CRUD on roles and permissions is also controlled by permissions.
Also, a user can also be assigned multiple roles.
This is used to verify and authorize users according to the access privileges that have been granted to them by the use-case.
The defined permissions, with meanings evident from their names, provisioned in the application are:
Roles | Users | Incoming Letters | Outgoing Letters |
|
|
|
|
Letter Reminders | Remarks | Colleges | Programmes |
|
|
|
|
Courses | Leaves | Phd Course Work | Scholar Progress Reports |
|
|
|
|
Scholar Documents | Phd Seminar | Title Approval | Scholar Examiner |
|
|
|
|
Teaching Records | Scholar Mentors | ||
|
|