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.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

user space permission remove

soumyajit November 13, 2020

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

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events