Skip to content

Commit 1de346f

Browse files
committed
Minor refactoring of admin policies
1 parent 2820295 commit 1de346f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/policies/admin/result_policy.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
module Admin
44
class ResultPolicy < ApplicationPolicy
55
def edit?
6-
user&.teams&.exists?(name: "Admins")
6+
user.present? && user.teams.exists?(name: "Admins")
77
end
88

99
def update?
10-
user&.teams&.exists?(name: "Admins")
10+
user.present? && user.teams.exists?(name: "Admins")
1111
end
1212
end
1313
end

0 commit comments

Comments
 (0)