Laravel-Backpack / PermissionManager

Admin interface for managing users, roles, permissions, using Backpack CRUD
http://backpackforlaravel.com
Other
516 stars 166 forks source link

Update spatie/laravel-permission requirement from ^4.0|^3.0 to ^5.3.0 #284

Closed dependabot[bot] closed 2 years ago

dependabot[bot] commented 2 years ago

Updates the requirements on spatie/laravel-permission to permit the latest version.

Release notes

Sourced from spatie/laravel-permission's releases.

5.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/5.2.0...5.3.0

Changelog

Sourced from spatie/laravel-permission's changelog.

5.3.0 - 2021-10-29

  • Option for custom logic for checking permissions (#1891)

5.2.0 - 2021-10-28

5.1.1 - 2021-09-01

  • Avoid Roles over-hydration #1834

5.1.0 - 2021-08-31

  • No longer flush cache on User role/perm assignment changes #1832 NOTE: You should test your app to be sure that you don't accidentally have deep dependencies on cache resets happening automatically in these cases. ALSO NOTE: If you have added custom code which depended on these flush operations, you may need to add your own cache-reset calls.

5.0.0 - 2021-08-31

  • Change default-guard-lookup to prefer current user's guard (see BC note in #1817 )
  • Teams/Groups feature (see docs, or PR #1804)
  • Customized pivots instead of role_id,permission_id #1823

4.4.1 - 2021-09-01

  • Avoid Roles over-hydration #1834

4.4.0 - 2021-08-28

  • Avoid BC break (removed interface change) on cache change added in 4.3.0 #1826
  • Made cache even smaller #1826
  • Avoid re-sync on non-persisted objects when firing Eloquent::saved #1819

4.3.0 - 2021-08-17

  • Speed up permissions cache lookups, and make cache smaller #1799

4.2.0 - 2021-06-04

  • Add hasExactRoles method #1696

4.1.0 - 2021-06-01

  • Refactor to resolve guard only once during middleware
  • Refactor service provider by extracting some methods

4.0.1 - 2021-03-22

  • Added note in migration for field lengths on MySQL 8. (either shorten the columns to 125 or use InnoDB)

4.0.0 - 2021-01-27

  • Drop support on Laravel 5.8 #1615
  • Fix bug when adding roles to a model that doesn't yet exist #1663
  • Enforce unique constraints on database level #1261

... (truncated)

Commits


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
tabacitu commented 2 years ago

I don't think we should remove support for v3 and v4 - but we should add support for v5, its release date (aug 2021) is far enough already.

@promatik can you please check if the v5 release brings any breaking changes for us? From what I can tell https://github.com/spatie/laravel-permission/pull/1817 is a good fix. Something that I remember I wanted too (can't remember why though... maybe something to do with the @can helpers not working with our guard... damn my memory? We need to make sure we're not introducing a change in behaviour as a non-BC here.

You should be able to install v5 by doing composer require spatie/laravel-permission:"^5.0 as 4.99.0" but check that it actually got the new version.

promatik commented 2 years ago

@tabacitu I tested the new version, and everything is working as expected 👌

Anyway, regarding that new feature, as far as I can understand, it's there to get the current auth guard, and use @can() or @role() automatically with that guard. But I could only use those blades directives when config('auth.defaults.guard') has the our backpack guard, without that it doesn't work – I'm on demo.

olipayne commented 2 years ago

Also have tested this and looking forward to seeing it merged!

dependabot[bot] commented 2 years ago

A newer version of spatie/laravel-permission exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.