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

[5.8] Add 'index' => 'viewAny' to resourceAbilityMap #28820

Merged
merged 1 commit into from Jun 12, 2019
Merged

[5.8] Add 'index' => 'viewAny' to resourceAbilityMap #28820

merged 1 commit into from Jun 12, 2019

Conversation

jcqtc
Copy link
Contributor

@jcqtc jcqtc commented Jun 12, 2019

Automatically bind the viewAny method to the index controller action

@GrahamCampbell GrahamCampbell changed the title add 'index' => 'viewAny' to resourceAbilityMap [5.8] Add 'index' => 'viewAny' to resourceAbilityMap Jun 12, 2019
@taylorotwell taylorotwell merged commit 21da43f into laravel:5.8 Jun 12, 2019
@tvbeek
Copy link
Contributor

tvbeek commented Jun 13, 2019

First of all I think this is a nice addition.
But it breaks if you don't have a viewAny on your policy and use $this->authorizeResource(Model::class, 'model');
That result in that I'm not sure that this isn't a backward compatibility break.

Maybe it is an idea for the next time to add it more clear to the releasenotes.

@jcqtc jcqtc deleted the abilityMap branch June 13, 2019 18:08
@danijelk
Copy link
Contributor

danijelk commented Jun 14, 2019

FYI it is a breaking change. We tried to add it last year but got rejected #26078 but glad it got through this time...

Time to update all our controller and policies :)

@jcqtc
Copy link
Contributor Author

jcqtc commented Jun 15, 2019

What if we check if the gate exists before actually adding it as a middleware ?

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.

None yet

4 participants