cancel
Showing results for 
Search instead for 
Did you mean: 

Lock/unlock a file

anshu_kumar
Star Contributor
Star Contributor

Hi,

I am using ADF 2.3.0 and ACS 5.2.1 and using built-in lock handler in content actions like below

<content-action
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.LOCK' | translate}}"
[icon]="'lock'"
[target]="'document'"
[handler]="'lock'">
</content-action>

In Release Note 2.3.0, it is mentioned "you can lock or unlock a file". However, when a file is locked, I don't see any option to unlock it. How does it work?

5 REPLIES 5

eugenio_romano
Elite Collaborator
Elite Collaborator

If you reopen the lock dialog and  click on the checkbox the file is unlock 

Hi Eugenio,

Since there is a handler available for lock/unlock functionality, I added few other properties and events of content actions to it.

<content-action
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.LOCK' | translate}}"
[icon]="'lock'"
[target]="'document'"
[handler]="'lock'"
[permission]="'update'"
[disableWithNoPermission]="true"
(permissionEvent)="onLockActionPermissionError($event)"
(success)="onLockActionSuccess($event)">
</content-action>

The (permissionEvent) and (success) events does not seems to work. I added these so I could show a pop-up on permission failure and reload the document list respectively. Ideally, Lock action should be made available to the owner only. I am sure Alfresco has plans to enhance the feature in coming releases. In the meantime, we were looking for a workaround to work best for our client.

Hi, note that the success action works only: 

Emitted when the action succeeds with the success string message. Applies to copy, move and delete actions.

So it is not goign to work with the unlock or lock. This is the link to the documentation:

alfresco-ng2-components/content-action.component.md at afa298060a62b57c0fde1e5606f02f67d29b20a3 · Al... 

If there is an error about the permissionEvent you can open a bug on the  GitHub repository explaining how to reproduce the problem

Thanks

Lucabil
Champ in-the-making
Champ in-the-making

do you want to ask about the PDF file?

Lucabil
Champ in-the-making
Champ in-the-making

Do you want to ask about the PDF file? If you are asking about PDF files then I would suggest the best solution to lock and unlock your PDF file. You have to do it professionally or through a third party so that your PDF file gets unlocked quickly. I suggest you unlock the PDF file professionally. It is called the OSTtoPSTAPP PDF Unlocker tool It will unlock your PDF file in less time and will not change the size of the PDF file It will unlock many PDF files without any problem It will reset the password of your important PDF file It will filter many of your PDF files. this tool supports all Windows OS versions. such as 11, 10 , 8 , 8.1 , 7 , XP and Vista.

Visit here: https://www.osttopstapp.com/pdf-unlocker.html