is($this->model->owner())) { return true; } if ($authUser->canDo('maintenance.workorder.action.copy')) { return true; } return false; } /** * Determine if the given user can approve the given workorder. * * @param UserPolicyInterface $authUser * * @return bool */ function empty(UserPolicyInterface $authUser, Workorder $workorder) { if ($authUser->is($this->model->owner())) { return true; } if ($authUser->canDo('maintenance.workorder.action.empty')) { return true; } return false; } /** * Determine if the given user can approve the given workorder. * * @param UserPolicyInterface $authUser * * @return bool */ public function transfer(UserPolicyInterface $authUser, Workorder $workorder) { if ($authUser->is($this->model->owner())) { return true; } if ($authUser->canDo('maintenance.workorder.action.transfer')) { return true; } return false; } /** * Determine if the given user can approve the given workorder. * * @param UserPolicyInterface $authUser * * @return bool */ public function delete(UserPolicyInterface $authUser, Workorder $workorder) { if ($authUser->canDo('maintenance.workorder.action.delete')) { return true; } return false; } }