From ad283fbb186fc3d8e72497e2d91a9625e3499cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C5=82gorzata=20Ksionek?= Date: Wed, 13 Mar 2019 13:24:03 +0000 Subject: Update group policy to reflect all the requirements --- app/policies/group_policy.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/policies/group_policy.rb') diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb index e74e5f008d7..db49d3bed9c 100644 --- a/app/policies/group_policy.rb +++ b/app/policies/group_policy.rb @@ -26,7 +26,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 }).execute.any? + GroupProjectsFinder.new(group: @subject, current_user: @user, options: { include_subgroups: true, only_owned: true }).execute.any? end condition(:has_clusters, scope: :subject) { clusterable_has_clusters? } @@ -55,6 +55,7 @@ class GroupPolicy < BasePolicy rule { has_projects }.policy do enable :read_list enable :read_label + enable :read_group end rule { has_access }.enable :read_namespace -- cgit v1.2.1