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



244
245
246
247
248
# File 'app/graphql/types/namespace_type.rb', line 244

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)


254
255
256
# File 'app/graphql/types/namespace_type.rb', line 254

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

#merge_requests_enabledObject



258
259
260
261
262
# File 'app/graphql/types/namespace_type.rb', line 258

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

  true
end

#root_storage_statisticsObject



264
265
266
# File 'app/graphql/types/namespace_type.rb', line 264

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

#subscribed_saved_view_limitObject



268
269
270
# File 'app/graphql/types/namespace_type.rb', line 268

def subscribed_saved_view_limit
  ::WorkItems::SavedViews::UserSavedView.user_saved_view_limit(object)
end

#timelog_categoriesObject



250
251
252
# File 'app/graphql/types/namespace_type.rb', line 250

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