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
|
|
|
|
2018-04-06 10:30:21 -04:00
|
|
|
def container_registry_enabled?(project)
|
2018-04-05 23:02:13 -04:00
|
|
|
Gitlab.config.registry.enabled &&
|
2018-04-06 10:30:21 -04:00
|
|
|
can?(current_user, :read_container_image, project)
|
|
|
|
end
|
2018-03-29 22:11:36 -04:00
|
|
|
end
|