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