Welcome to mirror list, hosted at ThFree Co, Russian Federation.

deploy_tokens_helper.rb « helpers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: eeeeb14d991a310ffd86c79887c30381af307ca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

module DeployTokensHelper
  def expand_deploy_tokens_section?(deploy_token)
    deploy_token.persisted? ||
      deploy_token.errors.present? ||
      Rails.env.test?
  end

  def container_registry_enabled?(subject)
    Gitlab.config.registry.enabled &&
      can?(current_user, :read_container_image, subject)
  end

  def packages_registry_enabled?(subject)
    Gitlab.config.packages.enabled &&
      subject.feature_available?(:packages) &&
      can?(current_user, :read_package, subject)
  end
end