Ability to edit groups (or click Edit Group button) even if you are not logged in?

AI-generated summary

A bug was reported where the “Edit Groups” button is visible and clickable to non-logged-in users, allowing access to administrative functions like changing text, flair, or managing users dax. While dax noted this appeared strange, testing by ChrisBeach confirmed that attempting to edit results in a 404 error and changes do not persist. ChrisBeach also highlighted a secondary issue where non-logged-in users see groups marked as “Closed” instead of being presented with actionable “Join” or “Request Membership” buttons that trigger a sign-up dialog. tgxworld acknowledged the bug and, after boddhisattva offered to assist, tgxworld approved the contribution. The primary security issue regarding the edit button was resolved in commit 3c4920d tgxworld, and the UI improvement for group actions was subsequently fixed in commit a481bf0 tgxworld.

I was reading this topic Improving the Groups page for 1.7 and visiting this forum https://se23.life/ to see “auto-join” in action when I realized that I can see (and click) the “Edit Groups” button (change text, flair, delete/add users etc…) even if I’m not logged in.
Imgur: The magic of the Internet

It seems very strange for a user not registered, note that I have not tried to edit anything, I would probably give me an error or permission denied.

Ping to @ChrisBeach for more tests.

5 Likes

Yea I noticed the bug. Will fix once I’m back from the holidays. :slight_smile:

3 Likes

Hi @tgxworld , I’m new to the Discourse codebase but I would like to take a look at this issue & see if I could fix it while you are away. Is that ok ?

4 Likes

Sure go for it :slight_smile:

2 Likes

Good spot @Trash. I just tried editing as a non-logged-in user and got a 404 error (and the edit didn’t persist).

Another minor point: when viewing the group list page as a non-logged-in user, groups are shown as “Closed” which is a little bit misleading. I think it would be nicer if the correct actions “Join” / “Request Membership” were shown, and clicking on them popped up the sign-up dialog (as per the behaviour with the like button).

2 Likes

Fixed in

https://github.com/discourse/discourse/commit/3c4920d234163815aac844b28eec09ef3e2f05c1

@Trash Thanks for reporting

4 Likes

https://github.com/discourse/discourse/commit/a481bf048facd5e0c9a896d52f210b450c5a3d08

@ChrisBeach Fixed as well :slight_smile:

2 Likes