Groups with a visibility level set to owner are not visible to staff, even though they should be. RGJ discovered this issue and questioned its intentionality, providing code snippets from Discourse’s source code. eviltrout confirmed that the code is 2 years old and seems intentional, but outofthebox reported a reversion of this behavior, having previously been able to view all groups as an admin.
Justin also experienced this issue and reported it separately, noting that it seems like a regression since version 2.4.beta2. He pointed out that it’s possible this issue is related to the Babble plugin, which modifies the Group model. RGJ confirmed that both affected forums have the Babble plugin installed, suggesting a potential link.
It seems that groups with visibility level owner are not visible for staff.
Visibility level staff does provide a mechanism to ensure visibility (using the left join instead of join and the extra where clause) but visibility level owner does not.
(hmm oneboxing Github source does not work anymore?)
SELECT g.id FROM groups g
LEFT JOIN group_users gu ON gu.group_id = g.id AND
gu.user_id = :user_id AND
gu.owner
WHERE g.visibility_level = :staff AND (gu.id IS NOT NULL OR :is_staff)
UNION ALL
SELECT g.id FROM groups g
JOIN group_users gu ON gu.group_id = g.id AND
gu.user_id = :user_id AND
gu.owner
WHERE g.visibility_level = :owners
It seems there has been a reversion here? Since starting with Discourse, as admin, I’ve had access to all groups. In the past couple of weeks, I have been unable to view many of them.
This is difficult because the group owners will ask me to do bulk invites through the admin interface to invite new groups of members to their group (and the associated private Categories).
In light of this, I would strongly advocate for all groups being visible to admins.