* Let moderators see name changes for deleted users on the user name change requests index and show pages. Before they could see name changes for deleted users on user profiles, but not on the user name changes index. * Let members see previous names on profile pages. Before they could see previous names on the user name changes index, but not on profile pages (ref: #4382).
14 lines
295 B
Ruby
14 lines
295 B
Ruby
class UserNameChangeRequestPolicy < ApplicationPolicy
|
|
def index?
|
|
user.is_member?
|
|
end
|
|
|
|
def show?
|
|
user.is_moderator? || (user.is_member? && !record.user.is_deleted?) || (record.user == user)
|
|
end
|
|
|
|
def permitted_attributes
|
|
[:desired_name, :desired_name_confirmation]
|
|
end
|
|
end
|