Role based strategy - pattern for jobs for example two maps deep

52 views
Skip to first unread message

Nico van de Kamp

unread,
May 8, 2020, 8:09:16 AM5/8/20
to Jenkins Users
Hello,

We use the plugin "Role strategy plugin / project matrix authorisation"

Let say I have in a map jobs like this:

mapx/
 - job 1
 - job 2

etc. Than the pattern is for example ^mapx.*, with Build, Cancel, Discover and Read. This working fine.


Now I have this
mapy
 - xxxx
   - job 1
   - job 2
 - yyyy
   - job 1
   - job 2
   - job n 
 - zzzz
   - job 1
   - job 2
   - job n
    
Now I want to give a user/group only give access to the jobs in map zzzz. What should be the pattern than????  I have tried the following (and more)
^mapy/zzzz.*
^mapy/zzzz*
^mapy/zzzz(.*)
^mapy\/zzzz.*
^(?i)mapy/zzzz.*

etc. but if I log in for this user mapx in shown up but not the mapy so that the user can have access to zzzz

I hope that someone can help me out with this.


Thanks in advance,

Best regards,

Nico

Nico van de Kamp

unread,
May 14, 2020, 11:42:13 AM5/14/20
to Jenkins Users
Hello,

Nobody has this issue that I can give a role access to a specific map and what the pattern than should be? I must say, we are going in the near future to a new version of Jenkins, but on this moment I'm talking about Jenkins version 2.9!

Nico.

Nico van de Kamp

unread,
May 19, 2020, 11:02:21 AM5/19/20
to Jenkins Users
Luckily I found somebody with the same issue although he had it working. What he wrote is if I go two maps deep I have to create three roles. And my expection was that I need to create one role!

So If I want to give access to the jobs in folder zzzz than what I was expecting was that I have to create one role like "^mapy/zzzz/.*". That is not working. You have to create a role with "^mapy/" another role with "^mapy/zzzz/" and "^mapy/zzzz/.*". This are roles to give someone explicit access to some jobs in x map deep. The rule is than: "you have create x roles map deep + 1"

This is not how I first should think but it is (code wise) done to create more flexibility.

Correct me if I'm wrong, but this working for me.

Nico
Reply all
Reply to author
Forward
0 new messages