Delete button is enabled for auto-generated groups

AI-generated summary

The Delete button is enabled for auto-generated groups, including Admin/Moderator/Staff and trust level groups, potentially causing concern. itsbhanusharma and hawm questioned the safety of deleting these groups. After reproduction, tshenry confirmed that no harm would occur, but suggested suppressing the delete button for automatic groups. jomaxro proposed alternative solutions, such as greying out the button or including a note, to avoid confusion. The issue has been assigned for cleanup and a fix has been implemented by Roman_Rizzi through pull request #12493, making the group’s delete button behave similarly to categories.

The default Admin/Moderator/Staff groups have Delete button enabled and visible. As far as I know Discourse didn’t allow for deleting these groups. Potentially a bug?

I haven’t dared to click the delete button because I don’t want to screw up the functionality. The delete button is also visible on trust level groups.

3 Likes

A post was split to a new topic: Start Upgrading button becomes active during docker-manager upgrades

I have the same question. Is staff or TL group are safe to be delete? If not that why it gona happen.

Can we repro this @tshenry ?

1 Like

I can repro, but thankfully it looks like nothing bad will happen:

I do think it would probably be ideal to suppress the delete button from automatic groups entirely.

2 Likes

Glad to see we display a clear message when you try deleting. I wonder though if removing the button will cause its own confusion. “Why do some groups not have the delete button?”

I’m not opposed to hiding the button, but would we want to instead grey it out like we do the delete button on the category edit page? Or include text noting that automatic groups can’t be deleted?

2 Likes

Sure we should probably assign this next week @eviltrout for some form of cleanup.

2 Likes

@Roman looks like we could use a Guardian method here for can_delete_group or similar? Can you handle it?

6 Likes

The group’s delete button now behaves the same way as the categories one. Should be fixed by:

https://github.com/discourse/discourse/pull/12493

4 Likes

This topic was automatically closed after 20 hours. New replies are no longer allowed.