Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doganoo/simple-rbac
Simple leightweight PHP Role Based Access Control library
https://github.com/doganoo/simple-rbac
access-control permission permission-manager permissions php php7 role role-based-access-control roles user-management
Last synced: 3 months ago
JSON representation
Simple leightweight PHP Role Based Access Control library
- Host: GitHub
- URL: https://github.com/doganoo/simple-rbac
- Owner: doganoo
- Created: 2018-06-11T21:25:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-24T09:09:16.000Z (about 1 year ago)
- Last Synced: 2024-10-13T12:25:17.779Z (3 months ago)
- Topics: access-control, permission, permission-manager, permissions, php, php7, role, role-based-access-control, roles, user-management
- Language: PHP
- Size: 136 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# simple-rbac
Simple leightweight PHP Role Based Access Control library## How does this library work?
I have tried to keep things simple. The main idea was to let the user implement an interface which provides the user and his permissions. The permissions are assigned to roles and roles are assigned to users.
The library provides a simple way to verify permissions without re-inventing the wheel.
The library is also available on Packagist: https://packagist.org/packages/doganoo/simple-rbac
missing something? create a pull request!
## Changelog
* 1.3.0 supporting owners:
## Installation
You can install the package via composer:
```bash
composer require doganoo/simple-rbac
```## Usage
There are two main interfaces you have to implement:
```
* doganoo\SimpleRBAC\Common\IUser
* doganoo\SimpleRBAC\Common\IDataProvider
```
The first interface represents the user to whom permissions are granted or denied. The second interface holds all necessary information, such as the user, a single permission and default permissions.IDataProvider can be used to connect to a data source (database, files, HTTP, etc.) in order to set up.
The ```doganoo\SimpleRBAC\Handler\PermissionHandler``` class uses the interfaces above to determine whether an action is permitted or not.
```doganoo\SimpleRBAC\Common\IPermission``` and ```doganoo\SimpleRBAC\Common\IRole``` interfaces represent a single permission and a user's role.
## Contributions
Feel free to send a pull request to add more algorithms and data structures.
## Maintainer/Creator
Doğan Uçar ([@doganoo](https://www.dogan-ucar.de))
## License
MIT