canDo('maintenance.workorder.approve')) { return true; } return false; } /** * Determine if the given user can approve the given workorder. * * @param Authenticatable $user * * @return bool */ public function submit(Authenticatable $user, Workorder $workorder) { if ($user->canDo('maintenance.workorder.submit')) { return true; } return false; } /** * Determine if the given user can approve the given workorder. * * @param Authenticatable $user * * @return bool */ public function publish(Authenticatable $user, Workorder $workorder) { if ($user->canDo('maintenance.workorder.publish')) { return true; } return false; } /** * Determine if the given user can approve the given workorder. * * @param Authenticatable $user * * @return bool */ public function unpublish(Authenticatable $user, Workorder $workorder) { if ($user->canDo('maintenance.workorder.unpublish')) { return true; } return false; } /** * Determine if the given user can approve the given workorder. * * @param Authenticatable $user * * @return bool */ public function archive(Authenticatable $user, Workorder $workorder) { if ($user->canDo('maintenance.workorder.archive')) { return true; } return false; } /** * Determine if the given user can approve the given workorder. * * @param Authenticatable $user * * @return bool */ public function unarchive(Authenticatable $user, Workorder $workorder) { if ($user->canDo('maintenance.workorder.unarchive')) { return true; } return false; } /** * Determine if the given user can approve the given workorder. * * @param Authenticatable $user * * @return bool */ public function reject(Authenticatable $user, Workorder $workorder) { if ($user->canDo('maintenance.workorder.reject')) { return true; } return false; } }