laravel / jetstream

Tailwind scaffolding for the Laravel framework.
https://jetstream.laravel.com
MIT License
3.96k stars 810 forks source link

Not all Actions are publishable? #1501

Closed bellwood closed 3 months ago

bellwood commented 4 months ago

Greetings,

Noticing that src/Actions/UpdateTeamMemberRole.php and src/Actions/ValidateTeamDeletion.php are not publishable stubs, meaning, we are not able to change the Gate check to validate those actions if folks opt to make changes to the roles in JetstreamServiceProvider.php

If the desire is not to make those Actions publishable, would it be considered to move those checks to TeamPolicy.php where all the other validation for Jetstream occurs?

Given the desire to keep Jetstream/teams as lean as possible (which is totally understandable) having some more control over what comes out-of-the-box would be very much appreciated (e.g the ability to publish more of the boilerplate)

Thank you very much.

crynobone commented 4 months ago

It might be best to describe what's missing from Gate::forUser($user)->authorize('updateTeamMember', $team); and Gate::forUser($user)->authorize('delete', $team);

bellwood commented 4 months ago

If you wish to use something other than updateTeamMember, delete or add additional logic, you cannot.

driesvints commented 3 months ago

Hey @bellwood I think it's best that you attempt a PR with either solution to see what Taylor has to say. Thanks!