discourse/app
Martin Brennan 38742bc208
FIX: Wrong scope used for notification levels user serializer (#13039)
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.
2021-05-14 09:45:14 +10:00
..
assets FIX: Delete unconfirmed emails first if available (#13046) 2021-05-13 16:14:00 +10:00
controllers FIX: Delete unconfirmed emails first if available (#13046) 2021-05-13 16:14:00 +10:00
helpers FEATURE: Allow theme tests to be run in production (take 2) (#12845) 2021-04-28 23:12:08 +03:00
jobs FIX: Recalculate scores only when approving or transitioning to pending. (#13009) 2021-05-10 14:09:04 -03:00
mailers FEATURE: Auto-activate users invited by email (#12675) 2021-04-14 12:15:56 +03:00
models FIX: Wrong scope used for notification levels user serializer (#13039) 2021-05-14 09:45:14 +10:00
serializers FIX: Wrong scope used for notification levels user serializer (#13039) 2021-05-14 09:45:14 +10:00
services DEV: Add service to validate email settings (#13021) 2021-05-13 15:11:23 +10:00
views DEV: Minor changes to /theme-qunit landing page (#13032) 2021-05-11 10:45:07 -04:00