Class: Types::Namespaces::Metadata::GroupNamespaceMetadataType

Inherits:
BaseObject
  • Object
show all
Defined in:
app/graphql/types/namespaces/metadata/group_namespace_metadata_type.rb

Overview

rubocop:disable Graphql/AuthorizeTypes – parent is already authorized

Instance Method Summary collapse

Methods inherited from BaseObject

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

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#group_idObject



33
34
35
# File 'app/graphql/types/namespaces/metadata/group_namespace_metadata_type.rb', line 33

def group_id
  group.id.to_s
end

#has_projects?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'app/graphql/types/namespaces/metadata/group_namespace_metadata_type.rb', line 29

def has_projects?
  GroupProjectsFinder.new(group: group, current_user: current_user).execute.exists?
end

#issue_repositioning_disabled?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/graphql/types/namespaces/metadata/group_namespace_metadata_type.rb', line 19

def issue_repositioning_disabled?
  group.root_ancestor.issue_repositioning_disabled?
end

#show_new_work_item?Boolean

Returns:

  • (Boolean)


23
24
25
26
27
# File 'app/graphql/types/namespaces/metadata/group_namespace_metadata_type.rb', line 23

def show_new_work_item?
  return false if group.self_or_ancestors_archived?

  can?(current_user, :create_work_item, group)
end