I need to add some permissions (Read, Build, View, cancel etc) to multiple users at the same time.
def users = [user1, user2]
for(user in users){
String userID = user;
jobDsl scriptText: """
folder('example') {
properties {
authorizationMatrixProperty {
inheritanceStrategy {
inheritingGlobal()
}
permissions(['hudson.model.Item.Read:authenticated',
'hudson.model.View.Read:authenticated',
'hudson.model.Item.Build:${user}',
'hudson.model.Item.Read:${user}'
.
.
.
])
}
}
}
"""
}
When running this, it first adds user1, then for the second time removes user1 and overwrites user2. How can I add permission access to both the users at once?