Expose project settings in REST API only for maintainer+ users
All threads resolved!
All threads resolved!
Compare changes
+ 10
− 6
@@ -16,13 +16,17 @@ def preload_relation(projects_relation, options = {})
@@ -16,13 +16,17 @@ def preload_relation(projects_relation, options = {})
with_options if: ->(project, options) { Ability.allowed?(options[:current_user], :read_issue, project) && project.feature_available?(:issuable_default_templates) } do
with_options if: ->(project, options) { Ability.allowed?(options[:current_user], :read_merge_request, project) && project.feature_available?(:issuable_default_templates) } do
with_options if: ->(project, options) { Ability.allowed?(options[:current_user], :admin_project, project) } do
expose :approvals_before_merge, if: ->(project, _) { project.feature_available?(:merge_request_approvers) }