Files
danbooru/app/policies/email_address_policy.rb
evazion baf0cf87af Fix #4571: Show banner when email verification is required.
* Show a banner if the user is restricted because they signed up from a
  proxy or VPN.

* Add an option to resend the confirmation email if your account has an
  unverified email address.
2020-08-02 16:48:45 -05:00

24 lines
498 B
Ruby

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?
if request.params[:email_verification_key].present?
record.valid_key?(request.params[:email_verification_key])
else
record.user_id == user.id
end
end
def send_confirmation?
# XXX record is a user, not the email address.
record.id == user.id
end
end