hasRole('admin') ? true : null; } public function viewAny(User $user): bool { return $user->can('view_scripts'); } public function view(User $user, SalesScript $script): bool { return $user->can('view_scripts') && ($user->can('manage_scripts') || ($script->is_active && $script->assignees()->whereKey($user->id)->exists())); } public function create(User $user): bool { return $user->can('manage_scripts'); } public function update(User $user, SalesScript $script): bool { return $user->can('manage_scripts'); } public function delete(User $user, SalesScript $script): bool { return $user->can('manage_scripts'); } }