Skip to content

Commit

Permalink
Incorporate PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
will-gant committed Dec 20, 2022
1 parent 2db8b34 commit 44029b8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions middleware/block_v3_only_roles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ def globally_authenticated?
end

def space_supporter_and_only_space_supporter?(current_user)
return false if VCAP::CloudController::User.
return false if VCAP::CloudController::User.db.select(1).
where do
Sequel.or(
[
[VCAP::CloudController::SpaceDeveloper.select(1).where(user_id: current_user.id).exists, true],
[VCAP::CloudController::OrganizationManager.select(1).where(user_id: current_user.id).exists, true],
[VCAP::CloudController::SpaceManager.select(1).where(user_id: current_user.id).exists, true],
[VCAP::CloudController::SpaceAuditor.select(1).where(user_id: current_user.id).exists, true],
[VCAP::CloudController::OrganizationAuditor.select(1).where(user_id: current_user.id).exists, true],
[VCAP::CloudController::OrganizationBillingManager.select(1).where(user_id: current_user.id).exists, true]
[VCAP::CloudController::SpaceDeveloper.limit(1).select(1).where(user_id: current_user.id).exists, true],
[VCAP::CloudController::OrganizationManager.limit(1).select(1).where(user_id: current_user.id).exists, true],
[VCAP::CloudController::SpaceManager.limit(1).select(1).where(user_id: current_user.id).exists, true],
[VCAP::CloudController::SpaceAuditor.limit(1).select(1).where(user_id: current_user.id).exists, true],
[VCAP::CloudController::OrganizationAuditor.limit(1).select(1).where(user_id: current_user.id).exists, true],
[VCAP::CloudController::OrganizationBillingManager.limit(1).select(1).where(user_id: current_user.id).exists, true]
]
)
end.any?

VCAP::CloudController::SpaceSupporter.select(1).where(user_id: current_user.id).any?
VCAP::CloudController::SpaceSupporter.where(user_id: current_user.id).any?
end

def roles
Expand Down

0 comments on commit 44029b8

Please sign in to comment.