Fix exploit making user name change reasons being public in API.
This commit is contained in:
@@ -89,4 +89,12 @@ class UserNameChangeRequest < ActiveRecord::Base
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def hidden_attributes
|
||||||
|
if CurrentUser.is_admin? || user == CurrentUser.user
|
||||||
|
[]
|
||||||
|
else
|
||||||
|
super + [:change_reason, :rejection_reason]
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user