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

Access permissions 3: Smaller refactorings #6879

Open
wants to merge 2 commits into
base: v5/develop
Choose a base branch
from

Conversation

lukasbestle
Copy link
Member

Description

Summary of changes

Smaller refactorings

Reasoning

Consistency and cleanup

Changelog

Housekeeping

  • Clean up permission-related code for consistency

Breaking changes

None

Docs

None

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

For review team

  • Add lab and/or sandbox examples (wherever helpful)
  • Add changes & docs to release notes draft in Notion

@lukasbestle lukasbestle added the type: refactoring ♻️ Is about bad code; cleans up code label Dec 23, 2024
@lukasbestle lukasbestle added this to the 5.0.0-beta.2 milestone Dec 23, 2024
@lukasbestle lukasbestle requested a review from a team December 23, 2024 09:41
@lukasbestle lukasbestle self-assigned this Dec 23, 2024
@@ -17,7 +17,7 @@
);
},
'page.preview' => function (Page $page) {
if ($page->permissions()->can('preview') === true) {
if ($page->permissions()->preview() === true) {
Copy link
Member

Choose a reason for hiding this comment

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

When working on the user roles, I ran into some problems where using the magic caller methods was inferior to directly calling the ->can() method. And tried to start moving away from using the magic methods. I can't remember right now what was the exact problem (maybe related to testing) - I'll try to remember.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactoring ♻️ Is about bad code; cleans up code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants