users: disallow banned users from changing email or deleting account.

This is to prevent people from wiping their email address after they've
been banned and reusing it to verify a new account.
This commit is contained in:
evazion
2021-05-15 04:36:22 -05:00
parent 4cf62c520c
commit 2537145b02
4 changed files with 24 additions and 1 deletions
+4
View File
@@ -74,5 +74,9 @@ class UserDeletion
if user.is_admin?
errors.add(:base, "Admins cannot delete their account")
end
if user.is_banned?
errors.add(:base, "You cannot delete your account if you are banned")
end
end
end