discourse/spec
Blake Erickson cb8746c7e7
FIX: Update sidebar links when promoted to admin (#18928)
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: 1b56a55f50

And: e320bbe513
2022-11-07 16:39:24 -07:00
..
fabricators SECURITY: Restrict display of topic titles associated with user badges (#18768) 2022-10-27 11:26:14 +08:00
fixtures A11Y: Set role=presentation if alt attr is missing (#18546) 2022-10-12 14:07:37 +03:00
helpers Meta topic: https://meta.discourse.org/t/meta-theme-color-is-not-respecting-current-color-scheme/239815 (#18832) 2022-11-07 10:06:26 +03:00
import_export DEV: Add a rake task to export/import translation overrides (#18487) 2022-10-05 15:22:16 -04:00
initializers Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
integration DEV: Add integration specs for Github login (#18808) 2022-11-02 16:21:51 +03:00
integrity DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
jobs DEV: Fix mocha deprecations (#18828) 2022-11-02 10:47:59 +01:00
lib PERF: Make stylesheet hashes consistent between deploys (#18909) 2022-11-07 16:13:35 +00:00
mailers DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
models FIX: Update sidebar links when promoted to admin (#18928) 2022-11-07 16:39:24 -07:00
multisite DEV: Fix mocha deprecations (#18828) 2022-11-02 10:47:59 +01:00
requests FIX: Welcome topic should be hidden on the /categories page as well (#18869) 2022-11-07 09:24:55 -07:00
script/import_scripts DEV: Remove remaining hardcoded ids (#18735) 2022-10-25 15:29:09 +08:00
serializers SECURITY: Restrict display of topic titles associated with user badges (#18768) 2022-10-27 11:26:14 +08:00
services DEV: Fix mocha deprecations (#18828) 2022-11-02 10:47:59 +01:00
support SECURITY: Expand and improve SSRF Protections (#18815) 2022-11-01 16:33:17 +00:00
system DEV: Minimal first pass of rails system test setup (#16311) 2022-09-28 11:48:16 +10:00
tasks DEV: Fix flaky uploads:disable_secure_uploads spec (#18719) 2022-10-25 09:01:15 +10:00
views Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
rails_helper.rb FEATURE: Generic hashtag autocomplete part 1 (#18592) 2022-10-19 14:03:57 +10:00
regenerate_swagger_docs DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
swagger_helper.rb DEV: Update rubocop (#18754) 2022-10-26 09:05:15 +08:00