All notable changes to laravel-permission will be documented in this file
- added hasAllPermissions method
- Reverted 2.12.0. REVERTS: "Add ability to pass guard name to gate methods like can()". Requires reworking of guard handling if we're going to add this feature.
- Add ability to pass guard name to gate methods like can()
- Improve speed of permission lookups with findByName, findById, findOrCreate
- changes the type-hinted Authenticatable to Authorizable in the PermissionRegistrar. (Previously it was expecting models to implement the Authenticatable contract; but really that should have been Authorizable, since that's where the Gate functionality really is.)
- Now findOrCreate() exists for both Roles and Permissions
- Internal code refactoring for future dev work
- Permissions now support passing integer id for sync, find, hasPermissionTo and hasDirectPermissionTo
- add compatibility with Laravel 5.6
- Allow assign/sync/remove Roles from Permission model
- Allow a collection containing a model to be passed to role/permission scopes
- Fix compatibility with Spark v2.0 to v5.0
- Support getting guard_name from extended model when using static methods
Changes related to throwing UnauthorizedException:
- When UnauthorizedException is thrown, a property is added with the expected role/permission which triggered it
- A configuration option may be set to include the list of required roles/permissions in the message
- REVERTED: Dynamic permission_id and role_id columns according to tables name NOTE: This Dynamic field naming was a breaking change, so we've removed it for now.
BEST NOT TO USE v2.7.7 if you've changed tablenames in the config file.
- updated
HasPermissions::getStoredPermissionto allow a collection to be returned, and to fix query when passing multiple permissions - Give and revoke multiple permissions
- Dynamic permission_id and role_id columns according to tables name
- Add findOrCreate function to Permission model
- Improved Lumen support
- Allow guard name to be null for find role by id
- added Lumen support
- updated
HasRole::assignRoleandHasRole::syncRolesto accept role id's in addition to role names as arguments
- fixed
Gate::beforefor custom gate callbacks
- added cache clearing command in
upmigration for permission tables - use config_path helper for better Lumen support
- refactor middleware to throw custom
UnauthorizedException(which raises an HttpException with 403 response) The 403 response is backward compatible
- refactor
PermissionRegistrarto use$gate->before() - removed
log_registration_exceptionas it is no longer relevant
- fixed a bug where
Roles andPermissions got detached when soft deleting a model
- add support for L5.3
- add
permissionscope
- register the blade directives in the register method of the service provider
- register the blade directives in the boot method of the service provider
- let middleware use caching
- add getRoleNames() method to return a collection of assigned roles
- add compatibility with Laravel 5.5
- automatically detach roles and permissions when a user gets deleted
- fix processing of pipe symbols in
@hasanyroleand@hasallrolesBlade directives
- add
PermissionMiddlewareandRoleMiddleware
- allow
hasAnyPermissionto take an array of permissions
- fix commands not using custom models
- add
create-permissionandcreate-rolecommands
hasanyroleandhasallrolecan accept multiple roles
- fixed a bug where
hasPermissionTowouldn't use the right guard name
- fixed a bug that didn't allow you to assign a role or permission when using multiple guards
- add
model_typeto the primary key of tables that use a polymorphic relationship
- fixed a bug where the role()/permission() relation to user models would be saved incorrectly
- added users() relation on Permission and Role
- fix a bug where the
role()/permission()relation to user models would be saved incorrectly - add
users()relation onPermissionandRole
- check for duplicates when adding new roles and permissions
- fix the order of the
foreignKeyandrelatedKeyin the relations
- Requires minimum Laravel 5.4
- cache expiration is now configurable and set to one day by default
- roles and permissions can now be assigned to any model through the
HasRolestrait - removed deprecated
hasPermissionmethod - renamed config file from
laravel-permissiontopermission.
- added support for Laravel 5.6
- allow
hasAnyPermissionto take an array of permissions
- fixed
Gate::beforefor custom gate callbacks
- refactor
PermissionRegistrarto use$gate->before() - removed
log_registration_exceptionas it is no longer relevant
- added compatibility for Laravel 5.5
- made foreign key name to users table configurable
hasPermissionTouses the cache to avoid extra queries when it is called multiple times
- add
getDirectPermissions,getPermissionsViaRoles,getAllPermissions
- add
hasAnyPermission
- add
log_registration_exceptionin settings file - fix for ambiguous column name
idwhen using the role scope
hasDirectPermissionmethod is now public
- added support for Laravel 5.4
- make exception logging more verbose
- added
Rolescope
- moved some things to
bootmethod in SP to solve some compatibility problems with other packages
- make compatible with L5.3
- fixes
givePermissionToandassignRolein Laravel 5.1
** this version does not work in Laravel 5.1, please upgrade to version 1.5.1 of this package
- allowed
givePermissonToto accept multiple permissions - allowed
assignRoleto accept multiple roles - added
syncPermissions-method - added
syncRoles-method - dropped support for PHP 5.5 and HHVM
- added
hasPermissionTofunction to theRolemodel
hasAnyRolecan now properly process an array
hasDirectPermissioncan now accept a string
- fixed user table configuration
- fixed bug when testing for non existing permissions
- added compatibility for Laravel 5.2
- use database_path to publish migrations
###Added
- support for custom models
- Blade directives
hasAllRoles()- andhasAnyRole()-functions
- Fix for running phpunit locally
- Fixed the inconsistent naming of the
hasPermission-method.
- Everything, initial release