This article describes how to configure jenkins to support role-based project permission management.
Because jenkins's default permission management system does not support user group or Role configuration, you need to install the third plug-in to support Role configuration, this article will use Role Strategy Plugin, the introduction page: https://wiki.jenkins-ci.org/display/JENKINS/Role+Strategy+Plugin
1. Configure the plug-in
After installing the plug-in, go to the system settings page and configure it as follows:
On the official website, the security domain is set as the Servlet container proxy. The actual operation found that the Jenkins private user database is also possible.
Ii. Configure permissions
On the System Management page, Click Manage and Assign Roles to go To the role management page:
1. Manage Roles)
Select this option to create a global role and project role, and assign permissions to the role.
For example, two global roles, admin and anonymous, and Online Program and test, are created respectively.
The difference between a project role and a global role is that a project role can only manage projects and does not have permission to manage jenkins configurations.
When adding a project role, you need to set a Pattern for matching the project, such as Pattern. The official document introduces that this option supports regular expressions, such as "Roger -. "indicates all projects starting with Roger-." (? I) roger -. * "indicates a project that starts with roger-and is case-insensitive. For example, a project that starts with ABC can be configured as" ABC | ABC. * ", you can also use" abc | bcd | efg "to directly match multiple projects.