Strapi plugin logo for Record Locking

Record Locking

Plugin for locking records so only one user can edit them at same time.

# Strapi plugin record-locking

Hey I am editing, don't change my content! Plugin

This plugin provides the ability to stop data loss when two users are editing the same record in STRAPI v4

Benefits

✅ Have only one user editing one record at a time ✅ Clearly shows you who is the other user editing the record

🧑‍💻 Install

1
2
3
npm i @notum-cz/strapi-plugin-record-locking

yarn add @notum-cz/strapi-plugin-record-locking



🖐 ⚠️ Read before installation



1. You need to create/modify file config/plugins.js with

1
2
3
4
5
module.exports = ({ env }) => ({
 "record-locking": {
    enabled: true,
  },
});


2. To suppport websocket protocol configure strapi middleware

For the config/middlewares.js file you will need to either replace 'strapi::security' with middleware object (example below) or update your existing configuration accordingly... 1. Ensure that "ws:" and "wss:" are present in strapi::security config under contentSecurityPolicy.directives.connect-src 2. Rebuild strapi and test record locking features. 3. There should be no Content Security Policy error in the console.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module.exports = [
  'strapi::errors',
  {
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          "connect-src": ["'self'", "https:",  "wss:", "http:"],
          "img-src": [
            "'self'",
            "data:",
            "blob:",
          ],
          "media-src": ["'self'", "data:", "blob:"],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  'strapi::cors', ...

This is optional but recommended as Socket.io will fallback to using http protocol and throws the following error in web console...

Refused to connect to <protocol>://<url> because it does not appear in the connect-src directive of the Content Security Policy

🛣️ Road map

  • ✨ Option to choose specific collection types
  • ✨ Add a "Takeover" button
  • ✨ Possibility to choose roles prioritization (Author cannot Takover SuperAdmin)

🐛 Bugs

We are using GitHub Issues to manage bugs.
If you want to help us you would be a rock ⭐.

🧔 Authors

The main star: Martin Čapek https://github.com/martincapek
Developer: Filip Janko https://github.com/fikoun
Project owner: Ondřej Janošík

🚀 Created with passion by Notum Technologies

  • Official STRAPI partner and Czech based custom development agency.
  • We love to share expertise with the open source community, that's why this plugin was created. 🖤

🎯 How can Notum help you with your STRAPI project?

✔️ We can help you develop custom STRAPI, web and mobile apps.
✔️ With 100+ projects, open communication and great project management we have the tools to get your project across the finish line.
📅 If you want to discuss your Strapi project, text us at info@notum.cz

Keywords

Install now

npm install @notum-cz/strapi-plugin-record-locking

Last updated

153 days ago

Strapi Compatibility

4.1.8 and above

Author

github profile image for Notum Technologies s.r.o.
Notum Technologies s.r.o.

Useful links

Create your own plugin

Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.