discourse/spec
Blake Erickson 738f1958d8
FIX: Only modify secured sidebar links on user promotion/demotion (#19141)
* FIX: Only modify secured sidebar links on user promotion/demotion

If a user is created populate their sidebar with the default
categories/tags that they have access to.

If a user is promoted to admin populate any new categories/tags that
they now have access to.

If an admin is demoted remove any categories/tags that they no longer
have access to.

This will only apply for "secured" categories. For example if these are
the default sitebar categories:

- general
- site feedback
- staff

and a user only has these sidebar categories:

- general

when they are promoted to admin they will only receive the "staff"
category. As this is a default category they didn't previously have
access to.

* Add spec, remove tag logic on update

Change it so that if a user becomes unstaged it used the "add" method
instead of the "update" method because it is essentially following the
on_create path.

On admin promotion/demotion remove the logic for updating sidebar tags because
we don't currently have the tag equivalent like we do for User.secure_categories.

Added the test case for when a user is promoted to admin it should
receive *only* the new sidebar categories they didn't previously have
access to. Same for admin demotion.

* Add spec for suppress_secured_categories_from_admin site setting

* Update tags as well on admin promotion/demotion

* only update tags when they are enabled

* Use new SidebarSectionLinkUpdater

We now have a SidebarSectionLinkUpdater
that was introduced in: fb2507c6ce

* remove empty line
2022-12-05 11:39:10 -07:00
..
fabricators PERF: stop downloading images from post processor and lean on uploads 2022-11-25 12:40:31 +11:00
fixtures PERF: stop downloading images from post processor and lean on uploads 2022-11-25 12:40:31 +11: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 FEATURE: Track API and user API requests (#19186) 2022-11-29 13:07:42 +02:00
integrity DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
jobs FIX: Exclude claimed reviewables from user menu (#19179) 2022-12-01 07:09:57 +08:00
lib FIX: Don't update url in GitImporter (#19273) 2022-12-01 10:50:06 -06:00
mailers SECURITY: Filter tags in user notifications for visibility (#19239) 2022-11-29 10:35:41 -06:00
models FIX: Only modify secured sidebar links on user promotion/demotion (#19141) 2022-12-05 11:39:10 -07:00
multisite DEV: Fix mocha deprecations (#18828) 2022-11-02 10:47:59 +01:00
requests FEATURE: Improve composer warnings for mentions (#18796) 2022-12-05 20:22:05 +02:00
script/import_scripts DEV: Remove remaining hardcoded ids (#18735) 2022-10-25 15:29:09 +08:00
serializers DEV: Remove user options from current user serializer (#19089) 2022-12-05 18:25:30 +02:00
services FIX: Push category hashtag slug match to top (#19174) 2022-11-25 15:28:49 +10:00
support FIX: horizontal scrolling was not working correctly (#19236) 2022-12-01 05:27:53 +08:00
system FIX: horizontal scrolling was not working correctly (#19236) 2022-12-01 05:27:53 +08:00
tasks FIX: Allow attr updates of over-size-limit uploads (#18986) 2022-11-11 17:56:11 +01:00
views DEV: use structured data in topic-list for referencing only (#16235) 2022-12-05 18:00:32 +02:00
rails_helper.rb FEATURE: Generic hashtag autocomplete lookup and markdown cooking (#18937) 2022-11-21 08:37:06 +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