Managing the project-related permissions through templates
This feature is available starting in Team plan.
As the organization admin, using permission templates allows you to define:
- The permissions granted by default to users, groups, project creators, and individual users on new projects.
- Different sets of permissions that a project admin can apply to their project at any time.
If you have a Free plan organization, you cannot use permission templates. The permissions set to the built-in groups (Members and Owners) on new projects are defined through the default built-in template and cannot be changed (these permissions are described in Built-in group permissions on Free plan in User group concept).
Introduction to the permission template concept
A permission template defines the project-related permissions granted to groups and members of the organization.
You can define several permission templates in your organization:
- You define the default template.
- You can define a template that applies to specific projects according to their key pattern by using a regular expression.
When a new project is created, SonarQube Cloud uses a permission template to grant the default permissions on the project. It retrieves the template according to the following rules:
- If the project key complies with the project key pattern of a template, then this template is used.
If several templates comply, an error is raised. - Otherwise, the default template is used.
The project admin can then change the permissions if necessary and apply any other template defined for the organization.
Creating a new template
- Retrieve the organization.
- Go to Administration > Permission Templates. The Permission Templates page opens with the list of templates.
- Select the Create button. The Create Permission Template dialog opens.
- Enter the template name and description.
- If you want to apply the template to specific new projects according to their key, enter the corresponding regular expression in Project key pattern.
- Select the Create button. The dialog closes and the new template is displayed.
- Set the permissions by selecting the respective check boxes.
Setting the default template
- Retrieve the organization.
- Go to Administration > Permission Templates. The Permission Templates page opens with the list of templates.
- Select the three-dot menu to the far right of the template you want to change.
- In the menu, select Set Default.
Deleting a template
- Retrieve the organization.
- Go to Administration > Permission Templates. The Permission Templates page opens with the list of templates.
- Select the three-dot menu to the far right of the template you want to delete.
- In the menu, select Delete and confirm.
Changing a template
- Retrieve the organization.
- Go to Administration > Permission Templates. The Permission Templates page opens with the list of templates.
- Select the three-dot menu to the far right of the template you want to change.
- In the menu:
- To change the template name, description or patter: select Update Details.
- To change the template permissions, description or patter: select Edit Permissions.
Applying a permission template to several projects at a time
- Retrieve the organization.
- Go to Administration > Projects management.
- Retrieve and select the projects you want to update.
- In the tool bar, select Bulk Apply Permission Template. The Bulk Apply Permission Template dialog opens.
- Select the template and select Apply.
Was this page helpful?