Rather than assigning individual permissions directly to each user, permissions are grouped into roles. You can define one or more roles on your site, and then grant permissions to each role.
Each user account on your site is automatically given the Authenticated user role, and may optionally be assigned one or more additional roles. When you assign a role to a user account, the user will have all the permissions of the role when logged in.
It’s a good practice to create several roles on your site.
GovCMS comes with a number of default roles:
- Job Seeker
- Content Author
- Content Approver
- Site Administrator
To explore available roles, navigate to People → Roles.
Hint: When assigning permissions to a role, always give the least permissions necessary. Test permissions beforehand.
In the case of our new Government Jobs Portal, our site needs three user roles:
- Job Seeker: Job seekers can’t create any content in the site but can save job applications (webforms) and update their profile.
- Content Author: These are the agency staff members who’ll be creating content for the website.
- Content Approver: These are the agency staff members who’ll be approving content for publishing.
In this exercise we’ll add our required roles of Job Seeker Content Author and Content Approver, then we’ll add users and assign roles to them.
- Create a new role
-
Go to People → Roles
-
Add the Job Seeker role (the Content Author and Content Approver roles exist in GovCMS8 out-of-the-box)
-
Reorder the roles with the role with least permissions at the top, and the most permissions at the bottom.
-
Click Save ![A screenshot of a cell phone
Description automatically generated](../.gitbook/assets/8%20%282%29.png)
-
- Add users
- Go to People
- Add two test users:
- testeditor - assign the Content Author role
- testjobseeker - assign the Job Seeker role
- Test user roles _****_Lastly, you need to test the new roles by logging in as the test accounts.
- Option 1: Logout of the superuser user/1 account and log back in again as testeditor or testjobseeker.
- Option 2: Open another browser and login as one of the test users.