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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user