3

https://wiki.jenkins-ci.org/display/JENKINS/Role+Strategy+Plugin. I have this plugin install to control the access to job folders, all works well. Now I don't know how to configure the Slave Roles, can't find any document on that. The requirement should be who or which project can be run on that slave?

Jirong Hu
  • 2,315
  • 8
  • 40
  • 63

2 Answers2

2

If the user demo_user can build on all the jenkins-centos* nodes, you can create the following role:

enter image description here

And next, affect this role to your user:

enter image description here

About the projects, if the demo_user can build all the Commons* projects:

enter image description here

enter image description here

I hope it helps :)

Bruno Lavit
  • 10,184
  • 2
  • 32
  • 38
  • I created a test project and restrict it only runs on salve I6329_1. Then I create a Slave role (role:I6329, pattern: I6329.*), and assign only my user jirong to the above role. But still I can login as mike to run this project successfully. Just to note, at the project role, mike is set to be able to anything for this project. The key is I don't know how to use this Slave roles. To restrict users to run jobs on that slave, or restrict projects on that slave? – Jirong Hu Nov 24 '15 at 16:39
  • 1
    I think you have to choose between the project role or the slave role for the Mike user. If Mike have the permissions with the project role, it will overwrite the slave role. If you want to add some restrictions on some jobs and for a particular node, create a slave role + update your job to run only on this slave. – Bruno Lavit Nov 24 '15 at 20:48
  • @BrunoLavit, if user mike has Build permissions in the Slave roles section, would she be allowed to build a project on that slave, even if she is not assigned the Build permission in the Project roles? You may want to incorporate information from your comments into your answer. – Amir Jan 04 '17 at 08:08
0

You will have to install the Authorize Project plugin (https://wiki.jenkins.io/display/JENKINS/Authorize+Project+plugin) and enable the option in configure security.

Bisi
  • 1