2018-03-30 02:11:36 +00:00
|
|
|
module DeployTokensHelper
|
2018-04-05 22:07:36 +00:00
|
|
|
def expand_deploy_tokens_section?(deploy_token)
|
|
|
|
deploy_token.persisted? ||
|
2018-03-30 02:11:36 +00:00
|
|
|
deploy_token.errors.present? ||
|
|
|
|
Rails.env.test?
|
|
|
|
end
|
2018-04-06 03:02:13 +00:00
|
|
|
|
2018-04-06 14:30:21 +00:00
|
|
|
def container_registry_enabled?(project)
|
2018-04-06 03:02:13 +00:00
|
|
|
Gitlab.config.registry.enabled &&
|
2018-04-06 14:30:21 +00:00
|
|
|
can?(current_user, :read_container_image, project)
|
|
|
|
end
|
2018-03-30 02:11:36 +00:00
|
|
|
end
|