users: add new owner level.

Add a new Owner user level for the site owner. Highly sensitive
operations like manually changing the passwords of other users will be
restricted to the site owner.
This commit is contained in:
evazion
2020-12-13 14:55:49 -06:00
parent 35134abe8f
commit b3ad13e6e3
7 changed files with 33 additions and 3 deletions

View File

@@ -64,7 +64,7 @@ class UserDeletion
errors.add(:base, "Password is incorrect")
end
if user.level >= User::Levels::ADMIN
if user.is_admin?
errors.add(:base, "Admins cannot delete their account")
end
end