Socket
Book a DemoInstallSign in
Socket

@gravitybv/strapi-plugin-permissions

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gravitybv/strapi-plugin-permissions

Strapi plugin that handles permissions through a config file.

latest
Source
npmnpm
Version
1.0.7
Version published
Maintainers
3
Created
Source

Strapi plugin - Permissions

npm version npm downloads License

This plugin is to have persistent permissions in different environments regarding api interaction.

Installation

  • Install using npm install @gravitybv/strapi-plugin-permissions in the root of your Strapi project.

No access to @gravitybv?

If you dont have access to the @gravitybv scope you need to do the following:

  • First you will need a personal access token (PAT)
  • Create a toke with repo and read:packages scopes selected. Make sure to store this somehwere
  • Run npm login --registry=https://npm.pkg.github.com --scope=gravitybv
  • Login with your github username and use the PAT as password
  • Now you should be able to install this package in other projects

Usage

Enable in config/plugins.js:

{
	"permissions": {
		"enabled": true
	}
}

The plugin will automatically create a file in the config/ directory of your Strapi installation. This newly created file is named config/permissions.js and will contain default permissions upon first install.

The permissions in this file will automatically be set upon Strapi bootstrap.

Naming

Please use the prefix plugin:: to target a specific plugin.

Use api:: to target one of your own controllers.

When only specifying the prefix and entity name, without targeting a controller (e.g. api::restaurant or plugin::users-permissions), the plugin will set the permissions for all of the controllers in that entity. To target a specific controller, please use: api::restaurant.restaurant, or plugin::users-permissions.auth.

Typescript

When using in a typescript project add a config to the plugin config:

config/plugins.js

{
	"permissions": {
		"enabled": true,
		"config": {
			"typescript": true
		}
	}
}

License

MIT License

Keywords

strapi

FAQs

Package last updated on 13 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts