Configuring item locking

Current version: 9.0

By default, users must lock an item before they can edit the item or change the workflow status of the item. This avoids conflicts created by multiple users trying to change an item at the same time. With the default configuration, items are neither locked nor unlocked automatically. Users with administrator rights are exempt from the requirement to lock items.

To change the behavior of locking and unlocking, an administrator or developer can configure one or more of the following settings.

  • RequireLockBeforeEditing - requires users (except those with admin rights) to lock an item before editing or changing workflow status. Set to True by default. If you disable this setting, users can change an item or workflow state without being required to lock the item.

  • AutomaticLockOnSave - causes items to be locked automatically when a user saves the item.

  • AutomaticUnlockOnSaved - causes items to be unlocked automatically when a user saves the item.

Note

Always use a patch file when you change Sitecore configuration settings.

Suggested configurations

You can combine the settings according to your requirements. Here are some examples of how the settings can work together:

  • To allow users to start editing without manually locking an item first, you can use these settings:

    RequireLockBeforeEditing=false and AutomaticLockOnSave=true

    Then the item is automatically locked after the user saves the item, to protect the item from conflicting edits. The user must unlock the item manually before other users can edit it.

  • To ensure that items do not remain locked for long periods of time, you can use these settings:

    RequireLockBeforeEditing=true and AutomaticUnLockOnSaved=true

    With these settings, the user must manually lock an item before editing it, and when they save the item, it is automatically unlocked. In this case, the user will have to lock the item again to continue editing, but it avoids the situation where a user leaves an item locked when they are out of the office or on vacation.

Do you have some feedback for us?

If you have suggestions for improving this article,