Commit ad9f5f86 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'issue_276476' into 'master'

Rename duplicated method name on ProjectPolicy

See merge request gitlab-org/gitlab!53167
parents fe0100c8 4e826597
...@@ -82,7 +82,7 @@ class ProjectPolicy < BasePolicy ...@@ -82,7 +82,7 @@ class ProjectPolicy < BasePolicy
with_scope :subject with_scope :subject
condition(:metrics_dashboard_allowed) do condition(:metrics_dashboard_allowed) do
feature_available?(:metrics_dashboard) access_allowed_to?(:metrics_dashboard)
end end
with_scope :global with_scope :global
...@@ -161,7 +161,7 @@ class ProjectPolicy < BasePolicy ...@@ -161,7 +161,7 @@ class ProjectPolicy < BasePolicy
features.each do |f| features.each do |f|
# these are scored high because they are unlikely # these are scored high because they are unlikely
desc "Project has #{f} disabled" desc "Project has #{f} disabled"
condition(:"#{f}_disabled", score: 32) { !feature_available?(f.to_sym) } condition(:"#{f}_disabled", score: 32) { !access_allowed_to?(f.to_sym) }
end end
# `:read_project` may be prevented in EE, but `:read_project_for_iids` should # `:read_project` may be prevented in EE, but `:read_project_for_iids` should
...@@ -696,7 +696,7 @@ class ProjectPolicy < BasePolicy ...@@ -696,7 +696,7 @@ class ProjectPolicy < BasePolicy
project.team.max_member_access(@user.id) project.team.max_member_access(@user.id)
end end
def feature_available?(feature) def access_allowed_to?(feature)
return false unless project.project_feature return false unless project.project_feature
case project.project_feature.access_level(feature) case project.project_feature.access_level(feature)
......
...@@ -16,7 +16,7 @@ module EE ...@@ -16,7 +16,7 @@ module EE
condition(:iterations_available) { @subject.feature_available?(:iterations) } condition(:iterations_available) { @subject.feature_available?(:iterations) }
with_scope :subject with_scope :subject
condition(:requirements_available) { @subject.feature_available?(:requirements) & feature_available?(:requirements) } condition(:requirements_available) { @subject.feature_available?(:requirements) & access_allowed_to?(:requirements) }
condition(:compliance_framework_available) { @subject.feature_available?(:compliance_framework, @user) } condition(:compliance_framework_available) { @subject.feature_available?(:compliance_framework, @user) }
...@@ -113,7 +113,7 @@ module EE ...@@ -113,7 +113,7 @@ module EE
with_scope :subject with_scope :subject
condition(:security_and_compliance_enabled) do condition(:security_and_compliance_enabled) do
@subject.feature_available?(:security_and_compliance) && feature_available?(:security_and_compliance) @subject.feature_available?(:security_and_compliance) && access_allowed_to?(:security_and_compliance)
end end
with_scope :subject with_scope :subject
......
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