mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 20:08:26 +00:00
It is likely that a new admin user was created as just a regular user before being promoted to admin so this change will update the sidebar link records for any users that are promoted to admin. This way if any of the default side bar categories or tags are restricted to admins these new admins will have those added to their sidebar as well. You can easily replicate this issue locally (prior to this fix) by using `rails admin:create` where it creates a user first, then it is promoted to admin. This means it would receive the default categories of regular user, but never receive the ones they should have access to as an admin. As part of this change I did drop the `!` from `SidebarSectionLink.insert_all` so that it would add any new records that were missing, but not throw a unique constraint error trying to add any existing records. Follow up to: 1b56a55f5087091a8573849a42c78f63992e1142 And: e320bbe513dc4a713ee4e44f81412915b213d7ec