Build-in authorization method of Jenkins (described in note "Jenkins user account configurations") have to deal with user rights one by one.
The following role-based method can create some roles and assgin some users to a role.
-
Install Role Strategy Plugin;
-
Start Jenkins Server;
-
Jenkins -> Manage Jenkins -> Global Security -> enable security;
-
Select "Jenkins's own user database" as the security realm;
-
Check "Allow user to sign up";
-
Select "Authorizaiton -> Role-based Strategy";
-
Manage Jenkins -> Manage and Assign Roles -> Manage Roles: create a role "admin" with all rights, "proj_leader", check Overall->Read and all of Jobs, Run, View and SCM;
-
Manage Jenkins -> Manage and Assign Roles -> Assign Roles: create user "admin" and assign role "admin" to it, create user "chad" and assign role "proj_leader" to it;
Note:
-
Ensure Overall->Read & Job->Discover is checked for user "Anonymous", or a 404 error will raised;
-
When user rights definition is changed, no need to restart Jenkins service to take effect;
-
Chinese charactor in user name is allowed and verified;