Coder Social home page Coder Social logo

strapi-users-permissions-export's Introduction

Strapi Users Permissions Export

Save your role permissions to config files that can be committed and reapplied to the database.


This is a cli tool to export strapi role permissions to a json file. It can also import the role permissions back into a strapi database.

This can be useful when switching branches with different permissions. Commit these exported files to your repository and import them when switching branches.

Permissions can be changed in the strapi admin panel and exported or changed directly in the json file and imported.

Setup

Create an full access api-key or user with these permissions:

  • userspermissions/createrole
  • userspermissions/getrole
  • userspermissions/getroles
  • userspermissions/updaterole

Strapi should be running alongside this cli tool.

Export Role Permissions from strapi database to json

Navigate to the root of your strapi project and run the following command:
npx strapi-users-permissions-export

This will show the help and run again with the flags to export your permissions.

Example:

  • v4 npx strapi-users-permissions-export -s http://localhost:1337/api -k <api-key> export
  • v3 npx strapi-users-permissions-export -v 3 -s http://localhost:1337 -u <email> -p <password> export

Import Role Permissions back into strapi database from json

Navigate to the root of your strapi project and run the following command:
npx strapi-users-permissions-export

This will show the help and run again with the flags to export your permissions.

Example:

  • v4 npx strapi-users-permissions-export -s http://localhost:1337/api -k <api-key> import
  • v3 npx strapi-users-permissions-export -v 3 -s http://localhost:1337 -u <email> -p <password> import

strapi-users-permissions-export's People

Contributors

darindev1000 avatar

Stargazers

Omar Ibrahim avatar  avatar  avatar Abdullah Al Mashmoum avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.