Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] Fix utility permissions not showing when using route caching #9059

Merged

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Nov 23, 2023

This pull request attempts to fix an issue where the permissions for utilities are missing when you're using route caching.

From what I can tell, without route caching it looks like the utilities are booted before the permissions are booted but with route caching, the permissions are booted before utilities are.

To workaround this, we've made the boot method in the UtilitiesRepository fluent so we can do Utility::boot()->all() to ensure utilities have always been booted before we use them.

Fixes #8691.

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Put guard clause inside boot so it does nothing if already booted.
  • In all, always boot().
  • In find and findBySlug, use $this->all() instead of $this->utilities
  • In routes you might be able to remove boot() since it calls all(), but test it out.

@duncanmcclean duncanmcclean marked this pull request as ready for review November 27, 2023 15:49
@jasonvarga jasonvarga merged commit b33e27a into 4.x Nov 27, 2023
36 checks passed
@jasonvarga jasonvarga deleted the fix/utility-permissions-not-showing-when-using-route-caching branch November 27, 2023 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Roles & Permissions form doesn't show the 'Utilities' section
2 participants