AbhyudayaSharma on master
Fix typo in example Merge pull request #51 from cal… (compare)
oleg-nenashev on JENKINS-61302
[JENKINS-61302] - Remove the bo… (compare)
After failed attempt at scavenging on internet, turning to gitter for help
Is it possible to assign a role in Jenkins on a per-PR basis?
How to do that?
Use-case : I want to assign a trigger job role to PR Authors
Thanks in advance.
we have two jenkins servers where we're managing our permissions with the Role strategy plugin. They both have Jenkins ver. 2.190.1 and role-strategy: 2.16.
On one server everything works as expected. The other one does apply changes for
item roles only after a Jenkins restart.
global roles are working fine and changes are reflected instantly. It doesn't matter if settings are changed over the ui or api. The changes are visible in ui and api but are not effective.
Can anyone point me into the right direction on how to further debug?
This should do it
import jenkins.model.Jenkins; import io.jenkins.plugins.folderauth.*; FolderBasedAuthorizationStrategy strategy = (FolderBasedAuthorizationStrategy) Jenkins.getInstance().getAuthorizationStrategy(); strategy.getGlobalRoles(); strategy.getAgentRoles(); strategy.getFolderRoles();
@AbhyudayaSharma our problem happens when we assign a user to a item role or remove it from a item role. We use item roles with patterns to grant access to top level folders.
I'm assigning an user to a existing role, the ui and the api show that the user is assigned to the role.
But the user does not see the folders he should have access to. Different browsers, deleting cache, new login does not help.
After restarting Jenkins, without changing anything else, and a new login of the user the user sees what its supposed to see. Same if I unassign a user.
If I assing or unassign to/from global roles, the user has immediate access respectively access gets immediately revoked.
This only happens on one of our Jenkins servers, even though they have the same Jenkins and role-strategy versions.
globaladmin? In the UI, https://jenkins-server/role-strategy/manage-roles