Hey I am editing, don't change my content
npm install @notum-cz/strapi-plugin-record-locking
Avoid concurrent edits on the same record in Strapi. Notify users when a record is being edited by another user, with an optional takeover feature.
- Table of Contents
- About the Project
- Features
- Screenshots
- Supported Versions
- Strapi V5.x.x
- Strapi V4.x.x
- Getting Started
- Installation
- 1. Install the plugin via npm or yarn
- [2. Enable the plugin in your Strapi config/plugins.[js|ts] file](#2-enable-the-plugin-in-your-strapi-configpluginsjsts-file)
- 3. Update Strapi middleware to enable websocket communication
- 4. Rebuild Strapi and test the plugin
- Plugin Configuration
- transports
- showTakeoverButton
- include and exclude options
- Roadmap
- Community
- This plugin is maintained by Notum Technologies, a Czech-based Strapi Enterprise Partner.
- Current maintainer
- Contributors
- How can Notum help you with your STRAPI project?
- Contributing
- Let users know when a record is being edited by another user
- Prevent concurrent edits on the same record
- Takeover an entry being edited by another user (optional)

This plugin is compatible with Strapi v5.x.x and Strapi v4.x.x.
#### Strapi V5.x.x
This is the primary and recommended version of Strapi. If using Strapi V5, use 2.x.x versions of this plugin. The latest plugin version has been tested with Strapi v5.34.0.
#### Strapi V4.x.x
If you are using Strapi V4, please use the 1.x.x versions of this plugin. Note that Strapi V4 has reached its end of life and is no longer actively maintained.
We will continue providing critical bug fixes through community contributions, but new features and improvements will be focused on Strapi V5.
#### 1. Install the plugin via npm or yarn
``bashNPM
npm i @notum-cz/strapi-plugin-record-locking
`
#### 2. Enable the plugin in your Strapi config/plugins.[js|ts] file
`typescript
// config/plugins.ts
export default () => ({
// -- your other plugins configs --
'record-locking': {
enabled: true,
},
});
`
#### 3. Update Strapi middleware to enable websocket communication
If you are using websockets for real-time communication, you will need to update Strapi's security middleware. Update your config/middlewares.[js|ts]:
`typescriptstrapi::security
export default [
'strapi::logger',
'strapi::errors',
// Replace entry with the following configuration:`
// ---- security middleware start ----
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:', 'ws:', 'wss:', 'http:'], // update with your preferred transport
'img-src': ["'self'", 'data:', 'blob:'],
'media-src': ["'self'", 'data:', 'blob:'],
upgradeInsecureRequests: null,
},
},
},
},
// ---- security middleware end ----
'strapi::cors',
'strapi::poweredBy',
'strapi::query',
'strapi::body',
'strapi::session',
'strapi::favicon',
'strapi::public',
];
> While optional, it is highly recommended to implement this step to prevent Socket.io from falling back to the HTTP protocol and generating the following error in the web console.
>
> Refused to connect to
#### 4. Rebuild Strapi and test the plugin
`bash`
yarn build
yarn start
This plugin has an optional config attribute. Below are the available configuration options:
#### transports
Array of transport methods for real-time communication. Defaults to ['polling', 'websocket', 'webtransport'] (see transports.ts).
Example:
`typescript
export default () => ({
// -- your other plugins configs --
'record-locking': {
enabled: true,
config: {
transports: ['websocket'],
},
},
});
`
#### showTakeoverButton
Boolean to show or hide the takeover button in the UI. Defaults to false.
If enabled, the notification dialog will include a "Takeover" button, allowing users to forcibly take over the record being edited by another user.
!Record Locking Plugin Takeover Feature - Before Takeover
Clicking the button will change the lock ownership. The user who was previously editing the record will be notified that they have lost the lock.
!Record Locking Plugin Takeover Feature - After Takeover
Example:
`typescript
export default () => ({
// -- your other plugins configs --
'record-locking': {
enabled: true,
config: {
showTakeoverButton: true,
},
},
});
`
#### include and exclude options
This plugin allows you to specify which content types should have record locking enabled or disabled using include and exclude options. All content types have record locking enabled by default.
- include: An array of content type UIDs to enable record locking for. If specified, only these content types will have record locking enabled.exclude
- : An array of content type UIDs to disable record locking for. If specified, these content types will not have record locking enabled.
> [!IMPORTANT]
> These options are mutually exclusive. You can only use one of them at a time. If you specify both, the include option will take precedence and the exclude option will be ignored.
Example:
`typescript
export default () => ({
// -- your other plugins configs --
'record-locking': {
enabled: true,
config: {
include: ['api::article.article', 'api::blog.blog'], // only these content types will have record locking enabled
// exclude: ['plugin::users-permissions.user'] // this option will be ignored if include is specified`
},
},
});
We're currently revising the roadmap for this plugin. Stay tuned for updates!
We're a software agency specializing in custom solutions based on Strapi. We're passionate about sharing our expertise with the open-source community.
This plugin is overseen by Ondřej Jánošík and it has been originally developed by Martin Čapek.
#### Current maintainer
#### Contributors
This plugin has been brought to you thanks to the following contributors:
✔️ We offer valuable assistance in developing custom STRAPI, web, and mobile apps to fulfill your requirements and goals..
✔️ With a track record of 100+ projects, our open communication and exceptional project management skills provide us with the necessary tools to get your project across the finish line.
To initiate a discussion about your Strapi project, feel free to reach out to us via email at sales@notum.cz. We're here to assist you!
Contributions are always welcome! Please follow these steps to contribute:
1. Fork the Project
2. Create your Feature Branch (git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature'
3. Commit your Changes ()git push origin feature/AmazingFeature`)
4. Push to the Branch (
5. Open a Pull Request