Hi,
While coding a WorkflowProcess implementation, I need to create a "system user" who can unlock pages.
Pages are locked through a WorkflowSession on a previous workflow step.
How can I give the "system user" the permissions to unlock pages?
Obviously I don't what to use an admin session, and I'm wondering how can I grant unlock permissions in AEM Security Permissions tab!
Thank you,
Lir
Solved! Go to Solution.
Views
Replies
Total Likes
I'd read a thread somewhere which I'll try to find again & post here. It mentioned that 'page.canUnlock()' won't work but 'page.unlock()' will.
I'd read a thread somewhere which I'll try to find again & post here. It mentioned that 'page.canUnlock()' won't work but 'page.unlock()' will.
Interesting!, I'll try that and let you know
That was it!
It works now with admin AND with the system user for which I set "jcr:all"
I will reduce the privileges to only what's required of unlocking and that would be it.
It is strange why page.canUnlock() would return false, but no harm now that I know.
Thank you
Views
Replies
Total Likes
Views
Replies
Total Likes
For me page.unlock() with system user having high privileges didn't work. But something like below worked for me though
page = pageManager.getPage(pagePath);
if (page.isLocked()) {
Node node = session.getNode(pagePath+"/jcr:content");
node.removeMixin("mix:lockable");
session.save();
}
Views
Replies
Total Likes
Finally!!
Its probably because the second user who is trying to unlock doesn't have the read permissions on /home/users/.. path to read it's own ACL to find out that can it unlock that specific /content path?
That might be the case for my system user, but it shouldn't happen for admin. It does though