gitlab-org--gitlab-foss/app/helpers/ci_variables_helper.rb
Miranda Fluharty fc8f4b62f8 Scaffold UI elements for minimal version
Add a masked switch to variable rows
Copy some behavior from the protected switch
2019-03-27 19:13:55 +00:00

23 lines
509 B
Ruby

# frozen_string_literal: true
module CiVariablesHelper
def ci_variable_protected_by_default?
Gitlab::CurrentSettings.current_application_settings.protected_ci_variables
end
def ci_variable_protected?(variable, only_key_value)
if variable && !only_key_value
variable.protected
else
ci_variable_protected_by_default?
end
end
def ci_variable_masked?(variable, only_key_value)
if variable && !only_key_value
variable.masked
else
true
end
end
end