summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-01-18 15:36:58 +0000
committerNick Thomas <nick@gitlab.com>2019-01-18 15:36:58 +0000
commit41ae26d9eacbe53213d0786589003b5119d383c4 (patch)
tree962004e553a0449546e5c62884a37e9c1c9734c1 /app
parent5e01cf72249725cb6e0c8aa3d28325d9b4942566 (diff)
parentab94a5a53712740df3836413bf26e4856b5f7cb2 (diff)
downloadgitlab-ce-41ae26d9eacbe53213d0786589003b5119d383c4.tar.gz
Merge branch 'api-nested-group-permission' into 'master'
Return the maximum group access level in the projects API Closes #43684 See merge request gitlab-org/gitlab-ce!24403
Diffstat (limited to 'app')
-rw-r--r--app/models/group.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index edac2444c4d..22814e35ca8 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -382,6 +382,10 @@ class Group < Namespace
end
end
+ def highest_group_member(user)
+ GroupMember.where(source_id: self_and_ancestors_ids, user_id: user.id).order(:access_level).last
+ end
+
def hashed_storage?(_feature)
false
end