Class: Types::NamespaceType

Inherits:
BaseObject
  • Object
show all
Defined in:
app/graphql/types/namespace_type.rb

Direct Known Subclasses

GroupType

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseObject

accepts, assignable?, authorization, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Class Method Details

.authorization_scopesObject



9
10
11
# File 'app/graphql/types/namespace_type.rb', line 9

def self.authorization_scopes
  super + [:ai_workflows]
end

Instance Method Details

#achievements_pathObject



214
215
216
217
218
# File 'app/graphql/types/namespace_type.rb', line 214

def achievements_path
  return unless Feature.enabled?(:achievements, object)

  ::Gitlab::Routing.url_helpers.group_achievements_path(object) if object.is_a?(Group)
end

#cross_project_pipeline_available?Boolean

Returns:

  • (Boolean)


224
225
226
# File 'app/graphql/types/namespace_type.rb', line 224

def cross_project_pipeline_available?
  object.licensed_feature_available?(:cross_project_pipelines)
end

#merge_requests_enabledObject



228
229
230
231
232
# File 'app/graphql/types/namespace_type.rb', line 228

def merge_requests_enabled
  return object.project.merge_requests_enabled? if object.is_a?(::Namespaces::ProjectNamespace)

  true
end

#root_storage_statisticsObject



234
235
236
# File 'app/graphql/types/namespace_type.rb', line 234

def root_storage_statistics
  Gitlab::Graphql::Loaders::BatchRootStorageStatisticsLoader.new(object.id).find
end

#timelog_categoriesObject



220
221
222
# File 'app/graphql/types/namespace_type.rb', line 220

def timelog_categories
  object.timelog_categories if Feature.enabled?(:timelog_categories)
end