pundit: convert user name change requests to pundit.
Fix discrepancy between index action and show action. The index action allowed members to see name changes for undeleted users, but the show action didn't.
This commit is contained in:
@@ -322,6 +322,10 @@ class User < ApplicationRecord
|
||||
User.level_string(value || level)
|
||||
end
|
||||
|
||||
def is_deleted?
|
||||
name.match?(/\Auser_[0-9]+~*\z/)
|
||||
end
|
||||
|
||||
def is_anonymous?
|
||||
level == Levels::ANONYMOUS
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user