Installation
1. Install the package
npm install @strapi-community/plugin-api-permissions
# or
yarn add @strapi-community/plugin-api-permissions
# or
pnpm add @strapi-community/plugin-api-permissions
2. Enable the plugin
config/plugins.ts
export default {
'api-permissions': {
enabled: true,
},
};
3. Start Strapi
pnpm develop
On first start, the plugin will:
- Extend your user content type with a
rolesmanyToMany relation. - Register a
content-apiauthentication strategy with Strapi. - Seed the database with a Public role and an Authenticated role.
Navigate to Settings → API Permissions → Roles to see the roles.
Next steps
- Configure the user content type (if not using
plugin-better-auth) - Register a session resolver so the plugin knows who is making each request