PHPackages                             tourze/rbac-core - 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. tourze/rbac-core

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

tourze/rbac-core
================

RBAC Core

1.0.0(6mo ago)02502MITPHPCI passing

Since Apr 17Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/tourze/rbac-core)[ Packagist](https://packagist.org/packages/tourze/rbac-core)[ RSS](/packages/tourze-rbac-core/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (2)

RBAC Core
=========

[](#rbac-core)

[English](README.md) | [中文](README.zh-CN.md)

A comprehensive Role-Based Access Control (RBAC) core library implementation for PHP 8.1+. This library provides complete RBAC0, RBAC1, and RBAC2 implementations with rule-based extensions.

Features
--------

[](#features)

- **RBAC0**: Basic role-based access control with users, roles, and permissions
- **RBAC1**: Role hierarchy support with inheritance
- **RBAC2**: Constraints including mutual exclusion and prerequisite roles
- **Rule System**: Flexible rule-based permission evaluation
- **Session Management**: Support for user sessions with role activation
- **Full Type Safety**: Complete PHP 8.1+ type hints and interfaces

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

[](#installation)

```
composer require tourze/rbac-core
```

Quick Start
-----------

[](#quick-start)

### Basic Usage

[](#basic-usage)

```
