role, ['superuser', 'manager']); } /** * Determine whether the user can update the model. */ public function update(User $user, Project $project): bool { // Only superusers and managers can update projects return in_array($user->role, ['superuser', 'manager']); } /** * Determine whether the user can delete the model. */ public function delete(User $user, Project $project): bool { // Only superusers and managers can delete projects return in_array($user->role, ['superuser', 'manager']); } /** * Determine whether the user can transition project status. */ public function updateStatus(User $user, Project $project): bool { // Only superusers and managers can transition status return in_array($user->role, ['superuser', 'manager']); } /** * Determine whether the user can set approved estimate. */ public function setEstimate(User $user, Project $project): bool { // Only superusers and managers can set estimates return in_array($user->role, ['superuser', 'manager']); } /** * Determine whether the user can set forecasted effort. */ public function setForecast(User $user, Project $project): bool { // Only superusers and managers can set forecasts return in_array($user->role, ['superuser', 'manager']); } /** * Determine whether the user can restore the model. */ public function restore(User $user, Project $project): bool { // Only superusers and managers can restore projects return in_array($user->role, ['superuser', 'manager']); } /** * Determine whether the user can permanently delete the model. */ public function forceDelete(User $user, Project $project): bool { // Only superusers can force delete projects return $user->role === 'superuser'; } }