summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-12-13 20:59:39 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-12-26 10:57:11 +0200
commit7b4b3d5f268534c028f55ef1014a84fe6a916cb0 (patch)
tree87408a9ae15c6263fbcfad84e97e2dc26446200b /app/policies
parent645412b57f558d58418aad278c9a3bf421439e1c (diff)
downloadgitlab-ce-7b4b3d5f268534c028f55ef1014a84fe6a916cb0.tar.gz
Include group parents into read access for project and group
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/group_policy.rb2
-rw-r--r--app/policies/project_policy.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb
index 6f943feb2a7..0be6e113655 100644
--- a/app/policies/group_policy.rb
+++ b/app/policies/group_policy.rb
@@ -4,7 +4,7 @@ class GroupPolicy < BasePolicy
return unless @user
globally_viewable = @subject.public? || (@subject.internal? && !@user.external?)
- member = @subject.users.include?(@user)
+ member = @subject.users_with_parents.include?(@user)
owner = @user.admin? || @subject.has_owner?(@user)
master = owner || @subject.has_master?(@user)
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb
index b5db9c12622..eaf3035dfe1 100644
--- a/app/policies/project_policy.rb
+++ b/app/policies/project_policy.rb
@@ -245,7 +245,7 @@ class ProjectPolicy < BasePolicy
def project_group_member?(user)
project.group &&
(
- project.group.members.exists?(user_id: user.id) ||
+ project.group.members_with_parents.exists?(user_id: user.id) ||
project.group.requesters.exists?(user_id: user.id)
)
end