mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
38742bc208
This is a recent regression introduced by https://github.com/discourse/discourse/pull/12937 which makes it so that when looking at a user profile that is not your own, specifically the category and tag notification settings, you would see your own settings instead of the target user. This is only a problem for admins because regular users cannot see these details for other users. The issue was that we were using `scope` in the serializer, which refers to the current user, rather than using a scope for the target user via `Guardian.new(user)`. However, on further inspection the `notification_levels_for` method for `TagUser` and `CategoryUser` did not actually need to be accepting an instance of Guardian, all that it was using it for was to check guardian.anonymous? which is just a fancy way of saying user.blank?. Changed this method to just accept a user instead and send the user in from the serializer. |
||
---|---|---|
.. | ||
admin_plugin_serializer_spec.rb | ||
admin_user_list_serializer_spec.rb | ||
basic_group_serializer_spec.rb | ||
basic_group_user_serializer_spec.rb | ||
basic_post_serializer_spec.rb | ||
basic_user_serializer_spec.rb | ||
category_detailed_serializer_spec.rb | ||
category_serializer_spec.rb | ||
category_upload_serializer_spec.rb | ||
current_user_serializer_spec.rb | ||
emoji_serializer_spec.rb | ||
group_show_serializer_spec.rb | ||
new_post_result_serializer_spec.rb | ||
notification_serializer_spec.rb | ||
post_revision_serializer_spec.rb | ||
post_serializer_spec.rb | ||
reviewable_flagged_post_serializer_spec.rb | ||
reviewable_queued_post_serializer_spec.rb | ||
reviewable_serializer_spec.rb | ||
reviewable_user_serializer_spec.rb | ||
single_sign_on_record_serializer_spec.rb | ||
site_serializer_spec.rb | ||
suggested_topic_serializer_spec.rb | ||
tag_group_serializer_spec.rb | ||
theme_serializer_spec.rb | ||
topic_link_serializer_spec.rb | ||
topic_list_item_serializer_spec.rb | ||
topic_list_serializer_spec.rb | ||
topic_view_details_serializer_spec.rb | ||
topic_view_posts_serializer_spec.rb | ||
topic_view_serializer_spec.rb | ||
upload_serializer_spec.rb | ||
user_auth_token_serializer_spec.rb | ||
user_bookmark_serializer_spec.rb | ||
user_card_serializer_spec.rb | ||
user_serializer_spec.rb | ||
user_summary_serializer_spec.rb | ||
web_hook_post_serializer_spec.rb | ||
web_hook_topic_view_serializer_spec.rb | ||
web_hook_user_serializer_spec.rb | ||
wizard_serializer_spec.rb |