Commit eb0a17ba authored by Maxim Rydkin's avatar Maxim Rydkin

replace `is_team_member?` with `team_member?`

parent fa030cbc
...@@ -17,13 +17,13 @@ class ProjectPolicy < BasePolicy ...@@ -17,13 +17,13 @@ class ProjectPolicy < BasePolicy
desc "Project has public builds enabled" desc "Project has public builds enabled"
condition(:public_builds, scope: :subject) { project.public_builds? } condition(:public_builds, scope: :subject) { project.public_builds? }
# For guest access we use #is_team_member? so we can use # For guest access we use #team_member? so we can use
# project.members, which gets cached in subject scope. # project.members, which gets cached in subject scope.
# This is safe because team_access_level is guaranteed # This is safe because team_access_level is guaranteed
# by ProjectAuthorization's validation to be at minimum # by ProjectAuthorization's validation to be at minimum
# GUEST # GUEST
desc "User has guest access" desc "User has guest access"
condition(:guest) { is_team_member? } condition(:guest) { team_member? }
desc "User has reporter access" desc "User has reporter access"
condition(:reporter) { team_access_level >= Gitlab::Access::REPORTER } condition(:reporter) { team_access_level >= Gitlab::Access::REPORTER }
...@@ -293,7 +293,7 @@ class ProjectPolicy < BasePolicy ...@@ -293,7 +293,7 @@ class ProjectPolicy < BasePolicy
private private
def is_team_member? def team_member?
return false if @user.nil? return false if @user.nil?
greedy_load_subject = false greedy_load_subject = false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment