Class: Types::Namespaces::Metadata::ProjectNamespaceMetadataType

Inherits:
BaseObject
  • Object
show all
Defined in:
app/graphql/types/namespaces/metadata/project_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

#default_branchObject



18
19
20
# File 'app/graphql/types/namespaces/metadata/project_namespace_metadata_type.rb', line 18

def default_branch
  project.default_branch_or_main
end

#group_idObject



37
38
39
# File 'app/graphql/types/namespaces/metadata/project_namespace_metadata_type.rb', line 37

def group_id
  group&.id&.to_s
end

#issue_repositioning_disabled?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'app/graphql/types/namespaces/metadata/project_namespace_metadata_type.rb', line 22

def issue_repositioning_disabled?
  project.root_namespace.issue_repositioning_disabled?
end

#show_new_work_item?Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
32
33
34
35
# File 'app/graphql/types/namespaces/metadata/project_namespace_metadata_type.rb', line 26

def show_new_work_item?
  return false if project.self_or_ancestors_archived?

  # We want to show the link to users that are not signed in, that way they
  # get directed to the sign-in/sign-up flow and afterwards to the new issue page.
  # Note that we do this only for the project issues page
  return true unless current_user

  can?(current_user, :create_work_item, project)
end