How to set up multiple admin users and different roles?
Amila Laravel CMS 1.x will not focus on the user system, it uses the existing Laravel user system. By default, the CMS has 3 admin roles:
'cms_admin' => [
'super_admin' => [1],
'web_admin' => [1],
'content_admin' => [1],
],
[1] is an array contains user ids. For example, below code is set up user id 1,3,28 as super_admin, user id 5, 9, 27 as web_admin:
'cms_admin' => [
'super_admin' => [1,3,28],
'web_admin' => [5,9,27],
'content_admin' => [1],
],
Currently, the 3 admin roles do not have too many different:
- super_admin: Can do everything
- web_admin: Will hide the system & plugin section from the cms setting page
- content_admin: Will only show the global section on the cms setting page
There is an admin_role javascript variable to indicate the current user role in the backend. eg.
var admin_route = "/cmsadmin";
var admin_role = "super_admin";
You can use the admin_role with jQuery to do some tricks like hiding something for the different admin roles.
How to do the changes?
You can find the predefined JSON data at system.cms_admin, do not forget to add your own user_id when you edit it.