Skip to content

Middleware: support enums in role/permission middleware #2813

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

Merged
merged 10 commits into from
Feb 28, 2025

Conversation

marklawntalk
Copy link
Contributor

No description provided.

@drbyte
Copy link
Collaborator

drbyte commented Feb 27, 2025

Thanks!
I think we should also test the handle() method of both middleware, as well. Which means also implementing the enum check there.
I've added a potential test (could be refined) as a starting point.

@marklawntalk
Copy link
Contributor Author

Thanks! I've updated the code to handle the handle method.

Copy link
Collaborator

@drbyte drbyte left a comment

Choose a reason for hiding this comment

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

Should also add the tests for the handle method on Roles.

@drbyte drbyte changed the title Allow Enum based roles and permission in middleware Middleware: support enums in role/permission middleware Feb 28, 2025
@drbyte
Copy link
Collaborator

drbyte commented Feb 28, 2025

Thanks

@drbyte drbyte merged commit 877e2c7 into spatie:main Feb 28, 2025
39 checks passed
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.

2 participants