deltoss/sentinel-database-permissions

A laravel package that extends sentinel to use permissions from database tables.

1.0.0 2019-01-20 10:50 UTC

This package is auto-updated.

Last update: 2024-04-18 10:02:43 UTC


README

CircleCI

Introduction

A Laravel package that configures Sentinel to use database permissions. Cartalyst Sentinel already has permissions, however their permissions are JSON values stored under the user or role record.

Some would prefer permissions to be a database table, to perform certain operations more efficiently when it comes to permissions. For example lets say we want to get a list of all permissions in the database.

In Cartalyst Sentinel, to get all permissions, you'd need to iterate through all users and roles, and for each of the user/role, you'd need to get their list of permissions and get only the distinct permissions. If you have a lot of users and roles, this approach won't be efficient. If you put permissions on a database table, then all you need to do is query that one table.

This package integrates with Sentinel and add its own set of methods. This means for the most part, you can use the Sentinel's API as per normal. The only caveat is before adding permissions, you'll need to create the ability on the database beforehand.

Requirements

  • Laravel Framework 5.5+
  • Cartalyst Sentinel 2.0+
  • php 7.1.3+

Documentation

The project documentation can be found in the repo's GitHub pages

License

MIT © Michael Tran