# Moderadores podem criar/alterar categorias de forma que percam o acesso

**URL:** https://meta.discourse.org/t/moderators-can-create-change-categories-such-that-they-lose-access/390978
**Category:** Bug
**Tags:** moderation
**Created:** [10 Dezembro , 2025 20:36 UTC](https://meta.discourse.org/t/moderators-can-create-change-categories-such-that-they-lose-access/390978 "2025-12-10T20:36:10Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [12 Dezembro , 2025 16:24 UTC](https://meta.discourse.org/t/moderators-can-create-change-categories-such-that-they-lose-access/390978/3 "2025-12-12T16:24:37Z")

</div>

Obrigado pelo relatório @Steradiant 👍

Agora mostraremos um diálogo de confirmação se o usuário estiver prestes a perder o acesso a uma categoria ao alterar suas permissões

> <https://github.com/discourse/discourse/pull/36663>
>
> When moderators with \`moderators\_manage\_categories\` enabled change category perm…issions, they could accidentally remove their own access, requiring admin intervention to fix.
> 
> This adds a client-side confirmation dialog that warns moderators before saving permission changes that would lock them out. If confirmed, the changes are saved and the user is redirected to the home page.
> 
> Changes:
> \- Add \`\_wouldLoseAccess()\` check in edit-category controller that compares new permissions against the user's group memberships
> \- Show confirmation dialog via \`dialog.yesNoConfirm()\` before saving
> \- Redirect to home page after confirmed save (since user can no longer access the category edit page)
> \- Fix \`onSelectGroup\` to properly set \`group\_id\` for custom groups by looking up from \`site.groups\` (was only working for auto groups)
> 
> Here's how the confirm dialog looks like
> 
> \<img width="1606" height="1043" alt="CleanShot 2025-12-12 at 17 12 55" src="https://github.com/user-attachments/assets/86e255dc-fa5c-4fde-8c86-3d3b0e03ce89" /\>
> 
> 
> Ref - https://meta.discourse.org/t/390978

---

_[View the full topic](https://meta.discourse.org/t/moderators-can-create-change-categories-such-that-they-lose-access/390978)._
