A common request is how to make groups 'read-only'. In other words, unless a user is a group admin, they should not be able to post new nodes to a group.

The attached patch involves changes to only 3 lines in the og.module and will change og to only allow read only groups. The result is that the audience list a user is presented with when editing a node is filtered to only show groups where the user is a group admin. The beauty of this approach is that form handling in Drupal prevents this being overridden with urls such as /node/add/page?gids[0]=3245
Even better, the og module neatly handles the case where a group member is editing a wiki page by listing the current group in the 'other' section of the group audience selector.

In my testing, this appears to work reliably.
The advantage of this solution is that it requires no access control modules (such as og_user_roles) or other modules such as og_content_type_admin.

Further improvements required:
1) A configuration option in the module settings
2) Although not necessary for our site, my preference would be for this setting to be on a per group type or even on a per content-type basis for posts within the group. For example, if a site wants to have read only groups, a new content type can be made a read-only group. Alternatively, a normal group could have an admin-only group post that could only be posted by group admins.

In the content type settings I would therefore add three new options (shown in []):

Organic groups usage:
- Group node
[- Admin-only Group node (only group admins may post to the group, regardless of content type)]
- May not be posted into a group.
- Standard group post (typically only author [or group admins] may edit).
[- Admin-only group post (only group admins may post and edit)]
- Wiki group post (any group member may edit).
[- Admin-only Wiki group post (only group admins may post any group member may edit).]
CommentFileSizeAuthor
readonly.patch1.74 KBscedwar

Comments

mr.alinaki’s picture

Version: 5.x-8.0 » 6.x-2.x-dev

Can you port this patch to 6.x-2.x? Please.

scedwar’s picture

Version: 6.x-2.x-dev » 5.x-8.0

I'm not running 6.x so can't do at the moment. Given it is only 3 lines, I wouldn't think it is much work for someone to make the changes who is running this version.

I've set the tag back to 5.x-8.0 as that is what the patch is against.

scedwar’s picture

If you are looking for a D6 module to do this, try this: http://drupal.org/project/og_read_only

claudiu.cristea’s picture

Status: Needs work » Closed (outdated)

This version of Drupal is not supported anymore. If this is still an issue in the 8.x-1.x branch, please open a new up-to-date ticket. Closing.