2018-08-18 07:19:57 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-29 22:11:36 -04:00
|
|
|
module DeployTokensHelper
|
2018-04-05 18:07:36 -04:00
|
|
|
def expand_deploy_tokens_section?(deploy_token)
|
|
|
|
deploy_token.persisted? ||
|
2018-03-29 22:11:36 -04:00
|
|
|
deploy_token.errors.present? ||
|
|
|
|
Rails.env.test?
|
|
|
|
end
|
2018-04-05 23:02:13 -04:00
|
|
|
|
2020-06-24 20:09:26 -04:00
|
|
|
def container_registry_enabled?(project)
|
2018-04-05 23:02:13 -04:00
|
|
|
Gitlab.config.registry.enabled &&
|
2020-06-24 20:09:26 -04:00
|
|
|
can?(current_user, :read_container_image, project)
|
2018-04-06 10:30:21 -04:00
|
|
|
end
|
2018-03-29 22:11:36 -04:00
|
|
|
end
|