Strapi Roles and Permissions Setup

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Strapi Roles and Permissions Setup
Simple
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1170
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1094
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    830
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    879
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    453

Roles and Access Permissions in Strapi

Strapi uses two access mechanisms: Users & Permissions (for public API users) and Role-Based Access Control (for administrators in admin panel). Configuration via GUI in Settings → Roles or programmatically.

Users & Permissions (public API)

The users-permissions plugin manages tokens and public user roles:

Built-in roles:

  • Public — unauthenticated requests
  • Authenticated — authorized via JWT
# Get JWT token
POST /api/auth/local
{ "identifier": "[email protected]", "password": "password" }
# Response: { "jwt": "...", "user": {...} }

# Request with token
GET /api/articles
Authorization: Bearer <jwt-token>

Setting permissions via API:

// Programmatic permission setup on bootstrap
async bootstrap({ strapi }) {
  const publicRole = await strapi.query('plugin::users-permissions.role')
    .findOne({ where: { type: 'public' } })

  // Allow public read of articles
  await strapi.query('plugin::users-permissions.permission').updateMany({
    where: { role: publicRole.id, action: 'api::article.article.find' },
    data: { enabled: true },
  })
}

Custom Role

// Create role via Admin: Settings → Roles → Add new role
// Or programmatically:
const role = await strapi.query('plugin::users-permissions.role').create({
  data: {
    name: 'Premium User',
    description: 'User with access to premium content',
    type: 'premium',
  },
})

Admin Panel RBAC

For administrators — separate role system:

Built-in admin roles:

  • Super Admin — full access
  • Editor — content management
  • Author — own records only
// Programmatic admin role creation
const editorRole = await strapi.query('admin::role').create({
  data: {
    name: 'Content Manager',
    description: 'Manage articles and categories only',
  },
})

// Assign permissions
await strapi.admin.services.permission.assignPermissions(editorRole.id, [
  { action: 'plugin::content-manager.explorer.read', subject: 'api::article.article' },
  { action: 'plugin::content-manager.explorer.create', subject: 'api::article.article' },
  { action: 'plugin::content-manager.explorer.update', subject: 'api::article.article' },
])

Field-level Permissions

// Restrict access to specific fields
await strapi.admin.services.permission.assignPermissions(roleId, [
  {
    action: 'plugin::content-manager.explorer.read',
    subject: 'api::article.article',
    properties: {
      fields: ['title', 'content', 'publishedAt'],  // only these fields
    },
  },
])

API Tokens (for server requests)

# Admin → Settings → API Tokens → Create new API Token
# Type: Read-only / Full access / Custom
// Usage
GET /api/articles
Authorization: Bearer <api-token>

Timeline

Setting up roles for editorial team (3–4 roles with different access levels) — 0.5–1 day.