Socket
Socket
Sign inDemoInstall

@strapi/plugin-users-permissions

Package Overview
Dependencies
Maintainers
9
Versions
1230
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@strapi/plugin-users-permissions

Protect your API with a full-authentication process based on JWT


Version published
Weekly downloads
118K
increased by12.07%
Maintainers
9
Weekly downloads
 
Created

What is @strapi/plugin-users-permissions?

@strapi/plugin-users-permissions is a plugin for Strapi, an open-source headless CMS. This plugin provides a robust system for managing user authentication, roles, and permissions. It allows developers to easily implement user registration, login, and role-based access control in their Strapi applications.

What are @strapi/plugin-users-permissions's main functionalities?

User Registration

This feature allows new users to register by providing a username, email, and password. The code sample demonstrates how to make a POST request to the registration endpoint.

fetch('/auth/local/register', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    username: 'exampleUser',
    email: 'user@example.com',
    password: 'password123'
  })
})
.then(response => response.json())
.then(data => console.log(data));

User Login

This feature allows users to log in by providing their email (or username) and password. The code sample demonstrates how to make a POST request to the login endpoint.

fetch('/auth/local', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    identifier: 'user@example.com',
    password: 'password123'
  })
})
.then(response => response.json())
.then(data => console.log(data));

Role-Based Access Control

This feature allows administrators to define roles with specific permissions. The code sample demonstrates how to create a new role with permissions for creating and updating articles but not deleting them.

const role = {
  name: 'Editor',
  description: 'Can edit content',
  permissions: {
    'application::article.create': true,
    'application::article.update': true,
    'application::article.delete': false
  }
};

fetch('/users-permissions/roles', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_ADMIN_TOKEN'
  },
  body: JSON.stringify(role)
})
.then(response => response.json())
.then(data => console.log(data));

Other packages similar to @strapi/plugin-users-permissions

FAQs

Package last updated on 14 Aug 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc