https://github.com/thecodingmachine/security.daos.tdbm
This package contains a basic user/role/right database model for TDBM.
https://github.com/thecodingmachine/security.daos.tdbm
Last synced: 7 months ago
JSON representation
This package contains a basic user/role/right database model for TDBM.
- Host: GitHub
- URL: https://github.com/thecodingmachine/security.daos.tdbm
- Owner: thecodingmachine
- Created: 2016-07-04T16:00:20.000Z (over 9 years ago)
- Default Branch: 1.2
- Last Pushed: 2022-12-06T15:28:33.000Z (almost 3 years ago)
- Last Synced: 2025-04-10T09:44:30.812Z (7 months ago)
- Language: PHP
- Size: 29.3 KB
- Stars: 1
- Watchers: 7
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://packagist.org/packages/mouf/security.daos.tdbm)
[](https://packagist.org/packages/mouf/security.daos.tdbm)
[](https://packagist.org/packages/mouf/security.daos.tdbm)
[](https://packagist.org/packages/mouf/security.daos.tdbm)
[](https://scrutinizer-ci.com/g/thecodingmachine/security.daos.tdbm/?branch=1.0)
TDBM DAOs for Mouf security
===========================
What is it?
-----------
This package contains a set of TDBM DAOs adding a basic user / role / right support for Mouf security.
This package will create tables for users, roles and rights.
Installation
------------
Run:
```
composer require mouf/security.daos.tdbm
```
Then, go to the Mouf user interface.
In Mouf:
- run the install tasks.
- apply the database patches
- regenerate TDBM DAOs
At this point, you should have a database with 4 additional tables: `users`, `users_roles`, `roles`, `roles_rights`.
Check the newly generated `UserBean` class.
Change this class so that:
- it extends `UserInterface`
- it uses the `UserTrait`
```php
use Mouf\Security\DAO\UserTrait;
use Mouf\Security\UserService\UserInterface;
/**
* The UserBean class maps the 'users' table in database.
*/
class UserBean extends UserBaseBean implements UserInterface
{
use UserTrait;
}
```
Adding new rights
-----------------
Available rights are listed in the `Mouf\Security\Rights\RightsRegistry`.
The `RightsRegistry` contains a list of rights implementing the `RightInterface`.
In order to add a new right, connect to Mouf, edit the `Mouf\Security\Rights\RightsRegistry` instance and drag'n'drop new rights in the `rights` property.