mouf / security.daos.tdbm
This package contains a basic user/role/right database model for TDBM.
Installs: 22 362
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 8
Forks: 3
Open Issues: 0
Type:mouf-library
Requires
- php: ^8.0
- mouf/database.patcher: ~2.0
- mouf/database.tdbm: ~5.3
- mouf/security.forgot-your-password-interface: ^1.1
- mouf/security.rightsservice: ^3.0
- mouf/security.user-management-ui-interface: ^1.0
- mouf/security.userservice: ^3.0
Requires (Dev)
- phpunit/phpunit: ^9.0
README
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
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.