Support for private group homepages
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #83005. -->
Reported by: [torne](https://www.drupal.org/user/13659)
>>>
<p>On my site I have a requirement to keep groups private from certain classes of users. To this end, I'd like several features, some of which I've implemented in the attached patch:</p>
<!--break--><ul>
<li>A role to control who can view the group listing at /og, to prevent anonymous or unprivileged users from seeing the list at all (implemented in the attached patch quite simply with permission "view organic groups list")</li>
<li>Proper support for groups' nodes not to be marked as public in the node_access table - currently if you manually remove the entry allowing the node to be public, access to the node itself is denied but the group details and group notification blocks still display and show the group name and options; also it is possible to subscribe (or request subscription) to a group that you do not have view permission for. (extra permission checks added in the attached patch to remove, as far as I can tell, all methods to access anything related to groups you cannot see)</li>
<li>Some way to configure the node_access entry for the group node. This is the part I've not implemented in the patch (I am doing it manually, all-or-nothing, for now). Exactly what form this should take is not immediately obvious, but I'm considering one of these:
<ol>
<li>Tying this directly to whether a group is listed in the directory or not; this makes groups either 'public' or 'private' in every way. It would effectively make all unlisted groups invite-only, though.</li>
<li>Requiring some permission to be set in order to access unlisted groups.</li>
<li>Adding a third state to the listed/unlisted state of each group, making it listed/unlisted/private. This is what I'm most likely to implement for now.</li>
<li>Some more clever scheme where each group can be visible to different subsets of the site users, perhaps based on membership in other existing groups, or roles, or some other critera.</li>
</ol>
</li>
<li>Some way to invite someone to join a group they cannot see, which would enable them to see it and accept or deny the invitation. Currently, in invite-only groups, users can only be directly added by the group manager without confirmation. Not implemented this either yet.</li>
</ul>
<p>I'd be interested to see what other users or developers of Organic Groups think of this functionality, and for someone to review the attached patch as it stands so far.</p>
issue