I am able to provide almost all permissions to user using groovy script. But i am unable to provide Lockable resources permission. I am using the below code:
import hudson.security.*
import jenkins.security.*
import jenkins.model.Jenkins
import hudson.model.User
def inst = Jenkins.getInstanceOrNull()
def strategy = inst.getAuthorizationStrategy()
strategy.add(org.jenkins.plugins.lockableresources.LockableResourcesManager.VIEW, “user_id”)
inst.save()
I am getting the below error:
groovy.lang.MissingPropertyException: No such property: VIEW for class: org.jenkins.plugins.lockableresources.LockableResourcesManager
I am getting similar error for replay permissions for RUN and move permissions for JOB. I am using the below code for them.
strategy.add(Item.MOVE, “user_id”) --for JOB
strategy.add(hudson.model.Run.REPLAY, “user_id”) --for RUN
Could anyone help me with this?