PHPackages                             fighting-pie/symfony-rbac - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. fighting-pie/symfony-rbac

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

fighting-pie/symfony-rbac
=========================

symfony bundle rbac

0.1.0(5y ago)11MITPHPPHP ^7.1

Since Nov 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/fightingPie/RbacBundle)[ Packagist](https://packagist.org/packages/fighting-pie/symfony-rbac)[ RSS](/packages/fighting-pie-symfony-rbac/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (19)Versions (2)Used By (0)

SymfonyRbacBundle
=================

[](#symfonyrbacbundle)

Principle explanation:
----------------------

[](#principle-explanation)

- **English document**: [en.md](./doc/en/symfony-rbac.md)
- **Chinese documents**:[cn.md](./doc/cn/symfony-rbac.md)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require fighting-pie/symfony-rbac "*"
```

or add

```
"fighting-pie/symfony-rbac": "*"
```

to the require section of your composer.json.

Usage
-----

[](#usage)

Once the extension is installed, simply modify your application configuration as follows:

### [Add Routing](https://symfony.com/doc/4.4/routing/custom_route_loader.html)

[](#add-routing)

```
#app/config/routes.yml

app_file:
    # loads routes from the given routing file stored in some bundle
    resource: '@SymfonyRbacBundle/Resources/config/routing/routes.yaml'

app_annotations:
    # loads routes from the PHP annotations of the controllers found in that directory
    resource: '@SymfonyRbacBundle/Controller/'
    type:     annotation

app_bundle:
    # loads routes from the YAML, XML or PHP files found in some bundle directory
    resource: '@SymfonyRbacBundle/Resources/config/routing/'
    type:     directory
```

### Rbac Database's configuration (ex)

[](#rbac-databases-configuration-ex)

[file of rbac-sql](doc/sql/symfony_rbac_202011160954.sql)

```
#app/config/packages/doctrine.yaml

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
              .....
            rbac:
                driver: 'pdo_mysql'
                url: '%env(resolve:DATABASE_RBAC_URL)%'
        # IMPORTANT: You MUST configure your server version,
        # either here or in the DATABASE_URL env var (see .env file)
        #server_version: '5.7'
    orm:
        default_entity_manager: default
        entity_managers:
            default:
              .....
            rbac:
                connection: rbac
                mappings:
                    RbacBundle:
                        is_bundle: true
                        type: annotation
                        dir: 'Entity'
                        prefix: 'SymfonyBundle\SymfonyRbac\Entity'
                        alias: Rbac
```

### Code

[](#code)

```

  use SymfonyRbac\Services\RbacManager;

  private $rbacManager;

  public function __construct(RbacManager $rbacManager) {
    $this->rbacManager = $rbacManager;
    $userId = 31;
    $permissionName = '/admin/user/31';
    $res =  $this->rbacManager->checkAccess($userId,$permissionName,[]);
  }
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2055d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/689fc88314c0b5dbdc0fb0df61ab81dbe679c53abf857e8dbe81e3ce1ae32cb4?d=identicon)[huangwenpai](/maintainers/huangwenpai)

---

Tags

permissionrbacrolesymfonysymfony-bundlesymfony4

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fighting-pie-symfony-rbac/health.svg)

```
[![Health](https://phpackages.com/badges/fighting-pie-symfony-rbac/health.svg)](https://phpackages.com/packages/fighting-pie-symfony-rbac)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k13](/packages/2lenet-crudit-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M734](/packages/sylius-sylius)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
