Role Based Access Control¶
Introduction¶
Security Roles allow you to:
- Restrict access to specific surveys so that even administrators who don’t have the required role, cannot access them
- Restrict access to specific columns that may contain sensitive data
- Restrict access to specific rows, for example a user from Region A may only be allowed to see data from Region A
A refresher on security groups:
- Users can only access surveys in projects that they are members of
- Users with Analyst privilege can access all data in all the surveys in their projects
- Users with Admin privilege can give themselves access to any project in the organisation and can give themselves Analyst privilege as well so in practice they can access everything
Recommended Approach¶
- Set up Role Based access for just a few surveys which contain particularly sensitive data
- Mainly use it with surveys that are stable over time rather than surveys that come and go quickly
- The main security controls should still be implemented using projects
- If you have a group of people who should work independently and not share data with other groups then you can create a separate organisation for them
Setting up Roles¶
There are 3 steps to setting up roles
- Create a role
- Assign users to a role
- Assign surveys to a role
After completion of these 3 steps only users with the specified role with be able to access the survey that has that role.
1. Creating Roles¶
Select the menu modules then admin then users. On the user management page select the roles tab.
Click on Add Role to create the role. You can give a role any name you like so choose something that is meaningful to you. Remember what is important about a role is not its name but the way it links a survey and a user.
2. Assign the role to a user¶
You can add or remove users from a role inside the role details dialog. Open the role for editing then click on "Users" to show the list of available users that can have the role.
ALternatively elect the users tab, then select the user that you want to assign the role. If you have the security privilege then you will see a section in the dialog labelled Roles. Select the roles that you want to assign to the user.
3. Assign the role to a form (Online Editor)¶
Open the survey in the online editor and then select the menu File then Roles.
You can then enable and disable roles for the form. If no roles are enabled then there are no role based restrictions on accessing the survey and its data. If at one role is enabled then users will need that role in order to access it. If more than one role is enabled then users will need at least one of the roles to access the survey.
Filtering¶
A user that has a role that is enabled for a survey can access the survey. However you can also restrict the rows and columns that they see.
If the user has more than 1 role enabled for the survey then the can access the union of the columns and rows allowed for each role.
For example role1 allows access to column q1 and role 2 allows access to column q2 then the user will have access only to columns q1 and q2.
Filtering is specified on the survey roles page where you have just enabled a role for a survey.
Filtering Rows¶
Rules for the rows that should be shown are entered the same syntax as for Server Calculations.
Example:
${region} = ‘region_a’
Only rows with a value of region_a for the region question will now be shown.
Assign the role to a Survey (XLS Editor)¶
To specify roles that filter columns add them to the survey work sheet and put a “yes” for each that is visible to that role.
To specify roles that filter rows add them to the settings work sheet and put the filter directly under the role
Specify roles as role::role_name
For example here is a form with a role called “test” that will filter rows.