GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - odiseoteam/SyliusRbacPlugin: Per-operation role-based access control for the Sylius admin.

BranchesTags
Open more actions menu

Latest commit

 

History

334 Commits
334 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
assets
assets
 
 
config
config
 
 
doc
doc
 
 
etc/build
etc/build
 
 
features
features
 
 
src
src
 
 
templates/admin
templates/admin
 
 
tests
tests
 
 
translations
translations
 
 
.dockerignore
.dockerignore
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
UPGRADE-3.0.md
UPGRADE-3.0.md
 
 
badge-partner-by-sylius.png
badge-partner-by-sylius.png
 
 
behat.yml.dist
behat.yml.dist
 
 
compose.override.dist.yml
compose.override.dist.yml
 
 
compose.yml
compose.yml
 
 
composer-dependency-analyser.php
composer-dependency-analyser.php
 
 
composer.json
composer.json
 
 
deptrac.yaml
deptrac.yaml
 
 
ecs.php
ecs.php
 
 
package.json
package.json
 
 
phpstan.neon
phpstan.neon
 
 
phpunit.xml.dist
phpunit.xml.dist
 
 
vitest.config.js
vitest.config.js
 
 

Repository files navigation

Odiseo Sylius RBAC Plugin

Version Downloads Build status Sylius versions PHP version License

Introduction

This plugin adds role-based access control to the Sylius admin: you define your own roles, one permission per operation on one resource, and it enforces them everywhere.

What makes this plugin different?

  • ✅ One permission per operation - sylius.product.update and sylius.product.delete are separate permissions
  • ✅ Every admin route and API operation covered - Permissions come from Sylius' own resource metadata, so routes added by other plugins are covered automatically
  • ✅ Deny by default - An unprotected route is denied, not allowed. Exceptions are explicit, in config
  • ✅ UI filtered, not just routes - Menu entries, grid buttons and dashboard widgets check the same permission
  • ✅ Workflow transitions included - Cancelling an order asks for sylius.order.cancel, not sylius.order.update
  • ✅ Multiple roles per administrator - Roles are additive, with a lockout guard on the roles screen
  • ✅ Console tooling - Grant access, list permissions, find orphaned ones and migrate v2 data from the CLI
  • ✅ 18 locales - Including English, Spanish, French, German, Polish, Portuguese, Simplified Chinese and Arabic
Screenshots

The permission tree

Administration roles
Roles: The ones you define, not a fixed list
Assigning roles
Assignment: An administrator may hold several roles
Filtered menu
Menu: Trimmed to what the role can reach
Filtered grid actions
Grids: No Create, no Delete, for a role without them

Getting Started

Install it in 5 steps ⚡

  1. ✅ Require the plugin
  2. ✅ Wire the assets
  3. ✅ Make your AdminUser administration-role aware
  4. ✅ Update the database schema
  5. ✅ Give someone access

👉 Follow the installation guide

Quick Example

Require the plugin. Symfony Flex's recipe registers the bundle and imports its config and routes for you:

composer require odiseoteam/sylius-rbac-plugin --no-scripts

Once the remaining steps are done, grant the first role from the console:

bin/console odiseo:rbac:grant <username-or-email> super_admin --create

Important

An administrator with no role is denied everything, including the screen that assigns roles. Right after installing, nobody can reach the admin panel until you grant that first role.

What a permission looks like

Every permission is {package}.{subject}.{operation}, the same code Sylius' own resource metadata produces:

Pattern Meaning
sylius.product.update One operation on one resource
sylius.product.* Everything on products
sylius.order.ship An operation that is not CRUD
*.*.index A read-only role, across the whole application
*.*.* A super administrator

A role stores the pattern as written, not the list of operations it matches today, so sylius.product.* keeps working when Sylius adds a new operation to products later.

Learn more about the permission model →

Documentation

  • 📦 Installation - Three steps with Flex, plus the two the recipe cannot do
  • 🔑 The permission model - Identifiers, patterns, wildcards, how the tree is built
  • 🛡️ What gets enforced - The six surfaces, and what happens to a route nobody covered
  • 👥 Managing roles - Day-to-day use of the admin screens
  • ⚙️ Configuration reference - Every key under odiseo_sylius_rbac
  • 🧩 Extending - Declaring permissions for your own routes and plugins
  • 💻 Console commands - grant, debug, migrate-permissions
  • 🚑 Troubleshooting - Locked out, unexpected 403, orphaned declarations
  • ⬆️ Upgrading to 3.0 - What breaks, and how stored roles are migrated
  • 🤝 Contributing - Running the test application and the suites

Compatibility

Plugin Sylius PHP Symfony Database
^3.0 2.0 · 2.1 · 2.2 8.2 · 8.3 · 8.4 6.4 · 7.x MySQL · MariaDB · PostgreSQL
^2.0 1.12 · 2.0 8.0+ 5.4 · 6.x MySQL · MariaDB

Note

The schema migrations ship for MySQL/MariaDB and PostgreSQL. On any other engine they skip, and Doctrine records them as executed even so, so write your own before upgrading a 2.x database, see Upgrading to 3.0.

Only the latest minor is supported. Security fixes land on master.

Professional Support

This plugin is maintained by Odiseo. Need help with it, or with any Sylius project?

  • 🎬 Live demo - A live walkthrough of this plugin
  • 🛠️ Sylius development - Help with this plugin or any Sylius project
  • 🏪 Multi-vendor marketplace - Vendor role separation is one of the things a marketplace has to get right, and this plugin is how we do it
  • 🔌 More Sylius plugins - Browse all our Sylius plugins

License

MIT.

About

Per-operation role-based access control for the Sylius admin.

Topics

permission-managerrbacroles-managementsyliussylius-plugin

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

8 stars

Watchers

3 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.