I'm trying to write a Scriptrunner for confluence script to modify the permissions of a page and I'm having trouble fully understanding the API.
I can get the permission set for a page/ceo but I'm not sure how to modify it and set the permissions back. I have this
def pageManager = ComponentLocator.getComponent(PageManager)
Page myPage = pageManager.getPage("SANDBOX","Perm Test")
ContentEntityObject ceo = myPage.getEntity()
ContentPermissionSet permSet = ceo.getContentPermissionSet(ContentPermission.EDIT_PERMISSION)
and I've tried various calls to
ContentPermissionManager.removeContentPermission(aPerm)
or
ContentPermissionManager.setContentPermissions(perms, ceo, ContentPermission.EDIT_PERMISSION)
but they throw errors so I'm not getting something right. I think I don't fully understand the concept so I'm not sure what to try.
Any help would be appreciated.