summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 62624f8eec1..68c52751804 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -109,7 +109,6 @@ class User < ApplicationRecord
# Groups
has_many :members
- has_one :max_access_level_membership, -> { select(:id, :user_id, :access_level).order(access_level: :desc).readonly }, class_name: 'Member'
has_many :group_members, -> { where(requested_at: nil) }, source: 'GroupMember'
has_many :groups, through: :group_members
has_many :owned_groups, -> { where(members: { access_level: Gitlab::Access::OWNER }) }, through: :group_members, source: :group
@@ -1080,7 +1079,7 @@ class User < ApplicationRecord
end
def highest_role
- max_access_level_membership&.access_level || Gitlab::Access::NO_ACCESS
+ user_highest_role&.highest_access_level || Gitlab::Access::NO_ACCESS
end
def accessible_deploy_keys