Skip to content

Releases: ajimoti/roles-and-permissions

1.1.2

24 Jan 12:23

Choose a tag to compare

** Minor Changes**

  • Merged traits folder content into concerns folder
  • Fetched all roles and permissions outside loops.

Full Changelog: 1.1.1...1.1.2

1.1.1

22 Jan 11:00
972ec22

Choose a tag to compare

What's Changed

  • Update readme file to reflect the new change by @ajimoti in #2
  • Updated readme file to contain information about tests by @ajimoti in #3
  • Introduce a new trait that acts as an interface for other traits that Interacts with models by @ajimoti in #4

Full Changelog: 1.1.0...1.1.1

Support for magic calls

15 Jan 01:17
9adc19d

Choose a tag to compare

For example:

After a model has been assigned a role, we shouldn't have to always use the ->hasRole() method to check if the user has a specific role. Or the holds() method to check if the model holds a permission. Developers should be able to prepend is with the role key and make a call on the model like so:

// $model->is{role_key}()
$model->isSuperAdmin(); // returns bool

// Or on a many-to-many relationship
$user->of($model)->isSuperAdmin();

Similarly, perpend can with the permission to check if the model has permission:

// $model->can{permission_key}()
$model->canDeleteTransactions(); // returns bool

// Or on a many-to-many relationship
$user->of($model)->canDeleteTransactions();

What's Changed

  • Include support for magic calls. by @ajimoti in #1

New Contributors

Full Changelog: 1.0.0...1.1.0

1.0.0

12 Jan 12:06

Choose a tag to compare

Fix styling