summaryrefslogtreecommitdiff
path: root/app/policies/group_policy.rb
diff options
context:
space:
mode:
authorFelipe Artur <fcardozo@gitlab.com>2019-09-04 16:33:02 +0000
committerMichael Kozono <mkozono@gmail.com>2019-09-04 16:33:02 +0000
commit13fc0efa5725d94cda527dc487d8dfdb7e90ed21 (patch)
treee059e8ad1ffece44218974140ec04cdfe8de5a07 /app/policies/group_policy.rb
parent24de5d65733de22fd067f150e65e36eb6121d17f (diff)
downloadgitlab-ce-13fc0efa5725d94cda527dc487d8dfdb7e90ed21.tar.gz
Let project reporters create issue from group boards
The current state of group issue boards does not show the "Add issues" button on the UI for users that are reporters of group child projects.
Diffstat (limited to 'app/policies/group_policy.rb')
-rw-r--r--app/policies/group_policy.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb
index 5d2b74b17a2..c726c7c24a7 100644
--- a/app/policies/group_policy.rb
+++ b/app/policies/group_policy.rb
@@ -1,6 +1,8 @@
# frozen_string_literal: true
class GroupPolicy < BasePolicy
+ include FindGroupProjects
+
desc "Group is public"
with_options scope: :subject, score: 0
condition(:public_group) { @subject.public? }
@@ -22,7 +24,7 @@ class GroupPolicy < BasePolicy
condition(:can_change_parent_share_with_group_lock) { can?(:change_share_with_group_lock, @subject.parent) }
condition(:has_projects) do
- GroupProjectsFinder.new(group: @subject, current_user: @user, options: { include_subgroups: true, only_owned: true }).execute.any?
+ group_projects_for(user: @user, group: @subject).any?
end
with_options scope: :subject, score: 0