Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I want to remove particular user permission from multiple spaces using confluence API through script runner console. Could you please help me with this matter?
def spacePermissions
def spaces = spaceManager.getAllSpaces()
def permissionsToRemove = []
spaces.each{ space ->
if(space.getKey()=='CSCO'){
spacePermissions = space.getPermissions()
spacePermissions.each{ it ->
if (it.getUserName() == "poc" && it.getType() == "VIEWSPACE"){
permissionsToRemove.add(it)
}
}
}
}
permissionsToRemove.each{it ->
log.warn it
//log.warn permissionsToRemove
//spacePermissionManager.removePermission(it)
spacePermissionManager.removePermission(it)
}
// but removePermission is invalid method