![]()
The sample illustrates the ability to lock/unlock selected item/document for the current user. The lock is implemented as item’s unique permissions set to Full Control for current user only. The lock is available only for items that inherit permissions from the parent. Items with unique permissions can’t be locked as we can’t unlock them correctly later on. All other permissions are deleted. The Command is available only for users who have “Manage Permissions” permissions for the list/document library.
Open this sample in the gallery (popup panel): Open in gallery
Source: https://github.com/pnp/sp-dev-fx-extensions/tree/main/samples/js-command-lock-item