Who may use the desk
By default, every user of the panel can. To limit it, name a Gate ability in the config:
'gate' => 'use-desk',And define it, for example in AppServiceProvider::boot():
use Illuminate\Support\Facades\Gate;
Gate::define('use-desk', fn ($user) => $user->is_support);Or give the plugin a closure. It takes the place of the gate:
->plugin(AparteDeskPlugin::make()->authorize(fn ($user) => $user->is_support))Someone the desk refuses does not see it in the menu, and gets a 403 if they open its address.
Everyone who may use the desk may also write the team’s saved replies. To keep that to some of them, give the model
a policy of your own; the desk follows it (viewAny, create, update, delete):
Gate::policy(\Aparte\FilamentDesk\Models\SavedReply::class, App\Policies\SavedReplyPolicy::class);