type == 'admin' || $user->type == 'creator'; } /** * Determine whether the user can view the model. */ public function view(User $user, UserTest $userTest): bool { return $user->id == $userTest->user_id || $user->type == 'creator' || $user->type == 'admin'; } public function canBeEdit(User $user, UserTest $userTest): bool { return ($user->id == $userTest->user_id && $userTest->isAvailable()) || $user->type == 'creator' || $user->type == 'admin'; } /** * Determine whether the user can create models. */ public function create(User $user): bool { return $user->type != 'banned'; } /** * Determine whether the user can update the model. */ public function update(User $user, UserTest $userTest): bool { return $user->type == 'admin'; } /** * Determine whether the user can delete the model. */ public function delete(User $user, UserTest $userTest): bool { return $user->type == 'admin'; } /** * Determine whether the user can restore the model. */ public function restore(User $user, UserTest $userTest): bool { return false; } /** * Determine whether the user can permanently delete the model. */ public function forceDelete(User $user, UserTest $userTest): bool { return false; } }