Hello, actually we want to reveal some documents at a given time. The documents already exist, but viewable (as well as editable) only for some specific users.
The idea is to reveal the documents at a given point of time e.g. regularly every saturday at 08:00 am.
We've licensed Scriptrunner Confluence app already for other features, but it seems that the "Jobs" feature with "CQL escalation service" could be a good solution:
- CQL query pages with a specific label
- Set up a cron to the required point in time
- And add an inline script to add permission/remove restriction
But it turns out, that the script is the problem here.
I've started to hack something, but without success.
The naiv idea would be to use the script below as a starting point, get the parent of the actual content page and add the parents permission to the actual content:
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.confluence.it.content.security
hits.each { content ->
log.warn "Removed the restriction from: ${content.title}"
// how to get the parent content permission? As it has no restrictions set.
// how to set that content permission to the content
// e.g. content.addPermission(parent permission)
}
Is it even possible to remove a restriction with a Job and if yes, could someone give me some hints, how to solve that?
Thank you very much in advance!