klsoft/yii3-rbac-doctrine

The package provides Yii RBAC storage using the Doctrine ORM

Maintainers

👁 klsoft-web

Package info

github.com/klsoft-web/yii3-rbac-doctrine

pkg:composer/klsoft/yii3-rbac-doctrine

Statistics

Installs: 25

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-04-23 10:46 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 1de70448fb8b997761b3c840066a5da1ef16689b

ormauthorizationdoctrineauthorisationrbacyii3

This package is auto-updated.

Last update: 2026-06-23 11:05:46 UTC


README

The package provides Yii RBAC storage using the Doctrine ORM.

Requirement

  • PHP 8.2 or higher.

Installation

composer require klsoft/yii3-rbac-doctrine

How to use

1. Configure the EntityManagerInterface.

2. Configure the CurrentUser.

use Yiisoft\User\CurrentUser;
use Yiisoft\Session\SessionInterface;
use Yiisoft\Access\AccessCheckerInterface;

return [
 // ...
 CurrentUser::class => [ 
 'withSession()' => [Reference::to(SessionInterface::class)], 
 'withAccessChecker()' => [Reference::to(AccessCheckerInterface::class)] 
 ],
];

3. Use the Doctrine console command to create or update the database schema.

Create the database schema:

./yii doctrine:orm:schema-tool:create

Update the database schema:

./yii doctrine:orm:schema-tool:update --force