Download the PHP package sehrgut/laravel-object-roles without Composer
On this page you can find all versions of the php package sehrgut/laravel-object-roles. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sehrgut/laravel-object-roles
More information about sehrgut/laravel-object-roles
Files in sehrgut/laravel-object-roles
Package laravel-object-roles
Short Description Roles & Permissions for Laravel where roles can be held in regard to a database object
License MIT
Informations about the package laravel-object-roles
Laravel Object Roles
Roles & Permissions for Laravel where roles can be held in regard to a database object
Table of Contents
- Why?
- Disclaimer
- Getting Started
- Documentation
- Create Roles & Permissions
- Assign Permissions to Roles
- Assign Roles to Users
- Check Permissions
- License
Why?
There are plenty of packages that add ACL functionalities to a Laravel application. Yet, none of the existing solutions seems to allow us to assign roles to users with respect to an object. We often come across a use case where we do not only need to define global roles, such as TECH_ADMIN
, but also roles in regard to a database object, such as an Organisation
, which has eg. EDITOR
users that are granted certain permissions only on that specific Organisation
and not on others.
Disclaimer
This package is in its very early days. It currently makes quite a few assumptions:
- Users are stored in a
users
table - The
users
table already exists when installing the package and running the migrations - The
users
table has a primary keyid
which is anunsigned integer
- Neither of the following tables exists before installing the package:
roles
permissions
permission_role
role_user
Getting Started
1. Install Package
2. Run database migrations
3. Use HasRolesAndPermissions
trait on the `User model
Documentation
Create Roles & Permissions
Assign Permissions to Roles
Assign Roles to Users
Check Permissions
License
This project is released under the MIT License.