Class: BaseService

Inherits:
Object
  • Object
show all
Includes:
BaseServiceUtility, Gitlab::Experiment::Dsl
Defined in:
app/services/base_service.rb

Overview

This is the original root class for service related classes, and due to historical reason takes a project as scope. Later separate base classes for different scopes will be created, and existing service will use these one by one. After all are migrated, we can remove this class.

For new services, please see docs.gitlab.com/ee/development/reusing_abstractions.html#service-classes

Direct Known Subclasses

Admin::AbuseReports::ModerateUserService, Admin::AbuseReports::UpdateService, Admin::PlanLimits::UpdateService, AlertManagement::MetricImages::UploadService, ApplicationSettings::BaseService, Auth::ContainerRegistryAuthenticationService, Auth::DependencyProxyAuthenticationService, AutoMerge::BaseService, AutoMergeService, AwardEmojis::BaseService, Boards::BaseService, Branches::CreateService, Branches::DeleteMergedService, Branches::DeleteService, Branches::ValidateNewService, Ci::CompareReportsBaseService, Ci::CreateCommitStatusService, Ci::CreateDownstreamPipelineService, Ci::CreatePipelineService, Ci::CreateWebIdeTerminalService, Ci::Deployments::DestroyService, Ci::DestroyPipelineService, Ci::DestroySecureFileService, Ci::ExternalPullRequests::CreatePipelineService, Ci::FindExposedArtifactsService, Ci::JobArtifacts::CreateService, Ci::JobTokenScope::AddGroupOrProjectService, Ci::JobTokenScope::AddGroupService, Ci::JobTokenScope::AddProjectService, Ci::JobTokenScope::RemoveGroupService, Ci::JobTokenScope::RemoveProjectService, Ci::JobTokenScope::UpdatePoliciesService, Ci::ListConfigVariablesService, Ci::ParseAnnotationsArtifactService, Ci::ParseDotenvArtifactService, Ci::PipelineBridgeStatusService, Ci::PipelineScheduleService, Ci::PipelineSchedules::CalculateNextRunService, Ci::PipelineTriggerService, Ci::PlayBridgeService, Ci::PlayBuildService, Ci::PlayManualStageService, Ci::ProcessBuildService, Ci::ResetSkippedJobsService, Ci::ResourceGroups::AssignResourceFromResourceGroupService, Ci::RetryJobService, Ci::RetryPipelineService, Ci::RunScheduledBuildService, Ci::UnlockArtifactsService, CloudSeed::GoogleCloud::BaseService, Clusters::Agents::AuthorizeProxyUserService, Clusters::Agents::CreateService, Commits::CreateService, Commits::TagService, ContainerRegistry::Protection::CreateRuleService, DependencyProxy::BaseService, Deployments::ArchiveInProjectService, DesignManagement::DesignService, Discussions::BaseService, DraftNotes::BaseService, Environments::CanaryIngress::UpdateService, Environments::CreateService, Environments::DestroyService, Environments::ResetAutoStopService, Environments::ScheduleToDeleteReviewAppsService, Environments::StopService, Environments::StopStaleService, Environments::UpdateService, FeatureFlags::BaseService, Git::BaseHooksService, Git::BranchPushService, Git::ProcessRefChangesService, Git::TagPushService, Git::WikiPushService, Groups::BaseService, Ide::BaseConfigService, Import::BaseService, Import::Github::CancelProjectImportService, Import::Github::GistsImportService, Import::PrepareService, IncidentManagement::PagerDuty::CreateIncidentIssueService, IssuableLinks::CreateService, IssuableLinks::DestroyService, JiraConnectSubscriptions::BaseService, Labels::BaseService, Lfs::LockFileService, Lfs::LocksFinderService, Lfs::PushService, Lfs::UnlockFileService, Mattermost::CreateTeamService, Members::BaseService, MergeRequests::MergeOrchestrationService, MergeRequests::MergeabilityCheckService, MergeRequests::MigrateExternalDiffsService, Milestones::BaseService, Notes::AbuseReport::UpdateService, Notes::BaseService, Notes::BuildService, Notes::ResolveService, ObjectStorage::DeleteStaleDirectUploadsService, Packages::Conan::SearchService, Packages::CreateDependencyService, Packages::CreateEventService, Packages::CreatePackageService, Packages::Generic::CreatePackageFileService, Packages::Go::CreatePackageService, Packages::Go::SyncPackagesService, Packages::Maven::FindOrCreatePackageService, Packages::MlModel::CreatePackageFileService, Packages::Npm::DeprecatePackageService, Packages::Npm::EnqueueDeprecatePackageWorkerService, Packages::Nuget::CheckDuplicatesService, Packages::Nuget::CreateDependencyService, Packages::Nuget::SearchService, Packages::RemoveTagService, Packages::Rubygems::DependencyResolverService, Pages::DeleteService, Pages::UpdateService, PagesDomains::CreateService, PagesDomains::DeleteService, PagesDomains::UpdateService, PersonalAccessTokens::CreateService, PersonalAccessTokens::RevokeService, Projects::AppleTargetPlatformDetectorService, Projects::AutoDevops::DisableService, Projects::AutocompleteService, Projects::BaseMoveRelationsService, Projects::CleanupService, Projects::ContainerRepository::DeleteTagsService, Projects::ContainerRepository::DestroyService, Projects::CreateFromTemplateService, Projects::CreateService, Projects::DeployTokens::CreateService, Projects::DeployTokens::DestroyService, Projects::DestroyService, Projects::DetectRepositoryLanguagesService, Projects::DisableDeployKeyService, Projects::DownloadService, Projects::EnableDeployKeyService, Projects::ForkService, Projects::Forks::SyncService, Projects::GitDeduplicationService, Projects::GroupLinks::CreateService, Projects::GroupLinks::DestroyService, Projects::GroupLinks::UpdateService, Projects::HashedStorage::BaseAttachmentService, Projects::HashedStorage::MigrationService, Projects::ImportExport::ExportService, Projects::ImportService, Projects::LfsPointers::LfsDownloadLinkListService, Projects::LfsPointers::LfsDownloadService, Projects::LfsPointers::LfsImportService, Projects::LfsPointers::LfsLinkService, Projects::LfsPointers::LfsListService, Projects::LfsPointers::LfsObjectDownloadListService, Projects::Operations::UpdateService, Projects::OverwriteProjectService, Projects::ParticipantsService, Projects::ReadmeRendererService, Projects::RecordTargetPlatformsService, Projects::RepositoryLanguagesService, Projects::TransferService, Projects::UnlinkForkService, Projects::UpdatePagesService, Projects::UpdateRemoteMirrorService, Projects::UpdateService, Projects::UpdateStatisticsService, ProtectedBranches::BaseService, ProtectedTags::CreateService, ProtectedTags::DestroyService, ProtectedTags::UpdateService, RemoteMirrors::CreateService, RemoteMirrors::DestroyService, RemoteMirrors::SyncService, RemoteMirrors::UpdateService, Repositories::BaseService, Repositories::RewriteHistoryService, ResetProjectCacheService, ResourceAccessTokens::CreateService, ResourceAccessTokens::RevokeService, SavedReplies::CreateService, SavedReplies::DestroyService, SavedReplies::UpdateService, Security::CiConfiguration::SastParserService, ServiceDeskSettings::UpdateService, Suggestions::ApplyService, Tags::CreateService, Tags::DestroyService, Terraform::RemoteStateHandler, Uploads::DestroyService, UserPreferences::UpdateService, Users::ActivateService, Users::ApproveService, Users::AutoBanService, Users::BannedUserBaseService, Users::BlockService, Users::BuildService, Users::CreateService, Users::DeactivateService, Users::RejectService, Users::ResetFeedTokenService, Users::TrustService, Users::UnblockService, Users::UntrustService, Users::UpdateHighestMemberRoleService, Users::UpdateService, Users::UpdateTodoCountCacheService, Users::UpsertCreditCardValidationService, Users::ValidateManualOtpService, Users::ValidatePushOtpService, VerifyPagesDomainService, Webauthn::AuthenticateService, Webauthn::DestroyService, Webauthn::RegisterService, WorkItems::RelatedWorkItemLinks::DestroyService

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?, #can_all?, #can_any?

Constructor Details

#initialize(project, user = nil, params = {}) ⇒ BaseService

Returns a new instance of BaseService.



16
17
18
19
20
# File 'app/services/base_service.rb', line 16

def initialize(project, user = nil, params = {})
  @project = project
  @current_user = user
  @params = params.dup
end

Instance Attribute Details

#current_userObject

Returns the value of attribute current_user.



14
15
16
# File 'app/services/base_service.rb', line 14

def current_user
  @current_user
end

#paramsObject

Returns the value of attribute params.



14
15
16
# File 'app/services/base_service.rb', line 14

def params
  @params
end

#projectObject

Returns the value of attribute project.



14
15
16
# File 'app/services/base_service.rb', line 14

def project
  @project
end