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

fix: allows policy result in after check callbacks as mentioned in docs #53259

Closed
wants to merge 1 commit into from

Conversation

bhushan
Copy link

@bhushan bhushan commented Oct 21, 2024

As mentioned in the docs, we can override results after the checks has been passed in after callback checks.

https://laravel.com/docs/11.x/authorization#intercepting-gate-checks

Scenario:

  • in my project I want to first check if user is allowed to access some api or not, and that is all resolved by default using sanctum.
  • now in after check, I want to fire up extra sql queries to make sure initial checks are passed.

@taylorotwell
Copy link
Member

We actually have tests specifically preventing this, so we may want to adjust the docs instead.

@bhushan
Copy link
Author

bhushan commented Oct 21, 2024

I see based on failing test cases, it is intentional, but we want to still override results even if it is true, so if we both are on same page, I can fix test cases for this PR, please let me know.

also if you do not agree with this, then please help me how i can do this

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