Commit f4991d95 authored by Rajendra Kadam's avatar Rajendra Kadam

Add helpers for ip and repo size limit

parent 5e7b2f71
# frozen_string_literal: true
module Admin
module IpRestrictionHelper
def ip_restriction_feature_available?(group)
group.licensed_feature_available?(:group_ip_restriction) || License.features_with_usage_ping.include?(:group_ip_restriction)
end
end
end
# frozen_string_literal: true
module Admin
module RepoSizeLimitHelper
def repo_size_limit_feature_available?
License.feature_available?(:repository_size_limit) || License.features_with_usage_ping.include?(:repository_size_limit)
end
end
end
......@@ -10,6 +10,7 @@ module EE
extend ::Gitlab::Utils::Override
extend ::Gitlab::Cache::RequestCache
include ::Gitlab::Utils::StrongMemoize
include ::Admin::RepoSizeLimitHelper
GIT_LFS_DOWNLOAD_OPERATION = 'download'
PUBLIC_COST_FACTOR_RELEASE_DAY = Date.new(2021, 7, 17).freeze
......@@ -601,7 +602,7 @@ module EE
current_size_proc: -> { statistics.total_repository_size },
limit: actual_size_limit,
namespace: namespace,
enabled: License.feature_available?(:repository_size_limit) || License.features_with_usage_ping.include?(:repository_size_limit)
enabled: repo_size_limit_feature_available?
)
end
end
......
- return unless License.feature_available?(:repository_size_limit) || License.features_with_usage_ping.include?(:repository_size_limit)
- return unless repo_size_limit_feature_available?
- form = local_assigns.fetch(:form)
......
- return if !(group.licensed_feature_available?(:group_ip_restriction) || License.features_with_usage_ping.include?(:group_ip_restriction)) || group.parent_id.present?
- return if !ip_restriction_feature_available?(group) || group.parent_id.present?
- hidden_input_id = 'group_ip_restriction_ranges'
- label_id = "#{hidden_input_id}_label"
......
- return unless current_user.admin? && License.feature_available?(:repository_size_limit) || License.features_with_usage_ping.include?(:repository_size_limit)
- return unless current_user.admin? && repo_size_limit_feature_available?
- form = local_assigns.fetch(:form)
- type = local_assigns.fetch(:type)
......
- return unless current_user.admin? && (License.feature_available?(:repository_size_limit) || License.features_with_usage_ping.include?(:repository_size_limit))
- return unless current_user.admin? && repo_size_limit_feature_available?
- form = local_assigns.fetch(:form)
- is_project = local_assigns.fetch(:type) == :project
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment