I am using lockmanager in code to lock/unlock the page. I am able to lock a page with user session, but when unlocking with user session it always fails (not the owner of lock). Is there anyway to create lock-superuser in aem and use that session to unlock it ?
As Arun said in AEM only admin or lock owner can unlock the page.No other user can unlock it.
However there is a way to unlock the page using admin session in AEM
You can use adminSession =slingRepository.loginAdministrative(null); and getadmin session and use that to unlock the page. It will wokr ,we are using the same. But this is deprecated api in newer version but still working as expected.