Module: DeployTokensHelper

Defined in:
app/helpers/deploy_tokens_helper.rb

Instance Method Summary collapse

Instance Method Details

#container_registry_enabled?(group_or_project) ⇒ Boolean

Returns:

  • (Boolean)

10
11
12
13
# File 'app/helpers/deploy_tokens_helper.rb', line 10

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

#expand_deploy_tokens_section?(deploy_token) ⇒ Boolean

Returns:

  • (Boolean)

4
5
6
7
8
# File 'app/helpers/deploy_tokens_helper.rb', line 4

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

#packages_registry_enabled?(group_or_project) ⇒ Boolean

Returns:

  • (Boolean)

15
16
17
18
# File 'app/helpers/deploy_tokens_helper.rb', line 15

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