diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-18 11:52:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-18 11:52:04 +0300 |
commit | 7e2d89989a48ecd55d3f118d7bf8c3a00e1038cb (patch) | |
tree | 11f24f04e0f11b451c84a224e0d1f07cfed25928 /app/policies/group_policy.rb | |
parent | a12a8608e6160bef7f2edca1e20192b69a83ff54 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'app/policies/group_policy.rb')
-rw-r--r-- | app/policies/group_policy.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb index 62f66093875..92cba5f8f7d 100644 --- a/app/policies/group_policy.rb +++ b/app/policies/group_policy.rb @@ -166,6 +166,7 @@ class GroupPolicy < BasePolicy def access_level return GroupMember::NO_ACCESS if @user.nil? + return GroupMember::NO_ACCESS unless user_is_user? @access_level ||= lookup_access_level! end @@ -173,6 +174,12 @@ class GroupPolicy < BasePolicy def lookup_access_level! @subject.max_member_access_for_user(@user) end + + private + + def user_is_user? + user.is_a?(User) + end end GroupPolicy.prepend_if_ee('EE::GroupPolicy') |