Skip to content

Commit

Permalink
fix: Search for non-admin users
Browse files Browse the repository at this point in the history
  • Loading branch information
mromulus committed Oct 6, 2023
1 parent dbd9b6e commit 31194a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/policies/application_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ def resolve

private
def accessible_actors_for_user(ex_id = exercise.id)
ex = Exercise.find(ex_id)
if (user.accessible_exercises[ex_id.to_s] & %w(rt local_admin)).any?
exercise.actors.pluck(:id)
ex.actors.pluck(:id)
else
exercise.actors.where.not(abbreviation: 'rt').pluck(:id)
ex.actors.where.not(abbreviation: 'rt').pluck(:id)
end
end

Expand Down

0 comments on commit 31194a9

Please sign in to comment.