Problem / motivation

As a site owner, I'd like to create invite-only groups whose content is publicly accessible. The Commons user interface currently only allows me to make private invite-only groups.

The use case here is for a large community that has "official" groups. These groups need to be invite-only, but public. This allows membership in the group to be moderated without group owners being spammed with requests to join the group, but still allows the group content to be publicly visible.

Proposed resolution

Change the commons_groups_form_group_node_form_alter() implementation to also toggle on field_og_access_default_value when the value is set to 'invitation' and clarify the field description for the invitation option.

This change should be low impact and not affect the API.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jrbeeman’s picture

Patch attached.

Local tests indicate that I can create groups in the following states without any trouble:
- Admin approval, publicly visible
- Admin approval, private
- Invite only, publicly visible
- Invite only, private

ezra-g’s picture

Status: Active » Needs review

Marking as "needs review."

heather’s picture

I'm a bit confused.. the default behavior seems to be "invite only groups, with public content".

I'm logged out, and I can see invite only group content.
https://www.evernote.com/shard/s22/sh/926bc62f-8fcb-43e0-a6bf-202c2c2e48...

japerry’s picture

Issue summary: View changes

If og_access is disabled, you essentially get this functionality. We're working on a bigger revamp of group permissions for commons though from conversations here #2227837: OG_CONTENT_ACCESS_FIELD is not set to 1 on a node in a group which is no longer private

japerry’s picture

If gdo is going to use commons and og_access, we'll need this functionality as well.