assign and block Permission handling for Laravel 8.0 and up
msr/laravel-permission-block is a Laravel package for assign and block permission handling for laravel 8.0 and up.
It currently has 3 GitHub stars and 4 downloads on Packagist (latest version v1.0.1).
Install it with composer require msr/laravel-permission-block.
Discover more Laravel packages by msr
or browse all Laravel packages to compare alternatives.
Last updated
This package is forked from laravel-permission developed by spatie
In additional main package, this package allows you to block user from permissions
Once installed you can do stuff like this:
$user->blockedPermissions // all permissions are blocked for user
// Block user from permission
$user->blockFromPermission('edit articles');
$user->blockFromPermission(['edit articles','view post']);
$user->hasBlockFromPermission('edit articles'); // return true
$user->hasDirectPermission('edit articles'); // return false
$user->hasPermissionTo('edit articles'); // return false
$user->can('edit articles'); // return false
$user->hasBlockFromAnyPermission(['edit article','view post']) // return true if any of passing permissions array are blocked
$user->unblockFromPermission('view post')
Please see CHANGELOG for more information what has changed recently.
composer test
If you discover any security-related issues, please email [email protected].
The MIT License (MIT). Please see License File for more information.