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