pundit: convert emails to pundit.

This commit is contained in:
evazion
2020-03-20 18:03:01 -05:00
parent a440c56ed8
commit 50fa674a3e
7 changed files with 76 additions and 24 deletions
+14
View File
@@ -0,0 +1,14 @@
class EmailAddressPolicy < ApplicationPolicy
def show?
record.user_id == user.id
end
def update?
# XXX here record is a user, not the email address.
record.id == user.id
end
def verify?
record.valid_key?(request.params[:email_verification_key])
end
end