main ← fix/sidebar-new-category-moderators
opened 09:57PM - 07 Feb 26 UTC
The sidebar "New category" action and the `/new-category` route were checking `c…urrentUser.admin` directly, which excluded moderators even when the `moderators_manage_categories` site setting was enabled.
This is inconsistent with the backend Guardian which already allows moderators to create categories when that setting is on.
Added `can_create_category` to `CurrentUserSerializer` (delegating to `Guardian#can_create_category?`) and updated the sidebar component and the new-category route to use it instead of manual role checks.
Ref - https://meta.discourse.org/t/395441