How to block some Jobs for some user level in Jenk

2019-05-24 14:00发布

问题:

I want a block some jobs for a user level for example I have 3 jobs:

Job1 (All the register user can execute this). Job2 (Only some user can execute this) Job3 (All the register user can execute this).

回答1:

Set the Global Security (http://<your_server>/configureSecurity/?) to the configuration that matches most jobs (enable Job Build) and then enable Project-based security for the other jobs (via the jon configuration) and set up as required by disabling Job Build.

Enter the user name in User/group to add: and then configure as required. In this case I've limited control to two users



回答2:

You need to use Project-based Matrix Authorization Strategy to achieve this. Hudson/Jenkin >> Manage Hudson >> Configre Security >> Authorization, and select Project-based Matrix Authorization Strategy. Now in the configuration page of each job you will have an option Enable job-based security. You can give access permissions for the users here.



回答3:

This works for me : Role Strategy Plugin

But you need understand it and its official documentation is poor, so go to :

https://stackoverflow.com/a/38516162/3957754



回答4:

The below link provides the clear guideline to grant/restrict the access to Jenkins Jobs. http://www.kblearningacademy.com/configure-role-strategy-plugin-in-jenkins/ Its very useful & am able to do the same.