role === 'super_admin'; } /** * Determine whether the user can view the model. */ public function view(User $user, Tenant $tenant): bool { if ($user->role === 'tenant_admin') { return (int) $user->tenant_id === (int) $tenant->getKey(); } return false; } /** * Determine whether the user can create models. */ public function create(User $user): bool { return $user->role === 'super_admin'; } /** * Determine whether the user can update the model. */ public function update(User $user, Tenant $tenant): bool { return $user->role === 'super_admin'; } /** * Determine whether the user can delete the model. */ public function delete(User $user, Tenant $tenant): bool { return $user->role === 'super_admin'; } /** * Custom ability for suspending a tenant. */ public function suspend(User $user, Tenant $tenant): bool { return $user->role === 'super_admin'; } }