laravel / jetstream

Tailwind scaffolding for the Laravel framework.

Home Page:https://jetstream.laravel.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not all Actions are publishable?

bellwood opened this issue · comments

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.

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

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

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