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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.