Allow mods to disable login, improve message when login disabled (#8329)
* Allow moderators to disable/enable login * Instead of rejecting login, show forbidden error when login disabled Avoid confusion because when login is rejected, the message is that the account is not activated, which is wrong. * Fix tests
This commit is contained in:
@ -18,11 +18,11 @@ class UserPolicy < ApplicationPolicy
|
||||
end
|
||||
|
||||
def enable?
|
||||
admin?
|
||||
staff?
|
||||
end
|
||||
|
||||
def disable?
|
||||
admin? && !record.admin?
|
||||
staff? && !record.admin?
|
||||
end
|
||||
|
||||
def promote?
|
||||
|
Reference in New Issue
Block a user