In our case all group posts are only visible within the targeted groups. However, group administrators are able to publish certain content.
I implemented this behaviour by setting the node authoring form options to:
Visibility of posts:
(*) Visible only within the targeted groups
( ) Visible within the targeted groups and on other pages
( ) Visibility chosen by author/editor using a checkbox on the posting form. Checkbox defaults to Public.
( ) Visibility chosen by author/editor using a checkbox on the posting form. Checkbox defaults to Private.
And by giving group administrators og adminstration permissions - that'll show them the "public" check box in the group field.
However, that meant that a group administrator could not only publicize any content in her group but also *publicize own posts in any other group she is merely subscriber of*.
To deny this, I added a custom module with a form_alter() implementation:
/**
* Implementation of hook_form_alter().
*/
function custom_form_alter($form_id, &$form) {
if ($form['#id'] = 'node-form') {
global $user;
$context = og_get_group_context();
if (array_key_exists($context->nid, $user->og_groups)) {
if (!$user->og_groups[$context->nid]['is_admin']) {
if (!user_access('administer nodes')) {
$form['og_nodeapi']['visible']['og_public']['#prefix'] = '<div style="visibility:hidden; display:none">';
$form['og_nodeapi']['visible']['og_public']['#suffix'] = '</div>';
}
}
}
}
}
Here are my 2 questions:
- is there anything foul with this approach?
- would a patch be welcome, that gives group adminstrators group-publish permissions? Sth like below?
Visibility of posts:
(*) Visible only within the targeted groups
( ) Visible within the targeted groups and on other pages
( ) Visibility chosen by author/editor using a checkbox on the posting form. Checkbox defaults to Public.
( ) Visibility chosen by author/editor using a checkbox on the posting form. Checkbox defaults to Private.
( ) Visibility chosen by group adminstrator using a checkbox on the posting form. Checkbox defaults to Public.
( ) Visibility chosen by group administrator using a checkbox on the posting form. Checkbox defaults to Private.
Or even simpler:
Visibility of posts:
(*) Visible only within the targeted groups
( ) Visible within the targeted groups and on other pages
Visibility of node can be changed by:
( ) author of node and any editor of node
( ) group adminstrators only
Comments
Comment #1
moshe weitzman@drupal.org commentedthe only foul bit is that you use css for this. if you wanted to be more secure, change the form field to type=value instead of type=checkbox.
the public checkbox and the audience selector are giving me serious headaches. i can't even decide what the right behavior is, so naturally can't code it. i really need some user interaction help here.
Comment #2
gracearoha commentedI would like to help out on this as i would also like to see it resolved, but not sure how i can help as i am not a coder.
Best i can do is report the experiences that i am having.
Am using D5.2, og 5.4, og actions 5x1, og calendar 5x1.1, og context tracker, og forum 5x1.3.
The behavior that i would find most helpful for my groups is:
group members cannot see audience checkboxes when they add a post, the post is visible only within the targeted group (members only have the opportunity to post within the group portal), therefore the "audience is required" (but is enabled by default for each group.
Group admins, on the other hand, can see the audience checkboxes and create posts in several groups and in public posts.
For now, no matter what i set the settings at, any post that i make within the group portal, is posted to that group and the public (homepage)
Comment #3
moshe weitzman commentedThis will happen with the preferences patch. http://drupal.org/node/192933
Comment #4
gibus commentedI've just released a contrib module, OG Access Admins, that provides a solution for the initial pb. raised by this issue. See http://drupal.org/project/og_access_admins
Comment #5
gibus commentedIn case @alex_b is still expecting a solution, I'm changing this issue statute to fixed. Sorry if I'm wrong doing this...
Comment #6
MickC commentedHi guys - I have a problem when enabling the public checkbox, as it slows down the content creation form considerably for admins.
I have several thousand groups and I think this has a lot to do with it.
When OG Access is set to " Visible within the targeted groups and on other pages." it is quite quick.
However for private groups I don't have a way for an admin to make a post public.
Any ideas on how to speed the form up?
Is it doing a lot of work e.g. having to look up every possible group?
Thanks
Comment #8
donquixote commentedHi,
The "duplicate" thread is getting old and dead (all talk was for D5). It does not look anymore like the place to look, for this issue to be solved..
Or am I wrong?
What I would need, is configurable permissions per type X:
- allow me to edit posts of type X in groups where I am the admin.
- allow me to pusblish / unpublish posts of type X in groups where I am the admin.
- allow me to change visibility (og public / private) of posts of type X in groups where I am the admin.
Some of this could be added to the content type options of "Organic groups usage"
Comment #9
Grayside commentedGroup Admins have edit privileges AFAIK. If not, the general workaround to this has been OGUR. This seems like something which should be fixed directly in og_access's node grants and linked to group type/node settings.
Comment #10
claudiu.cristeaThis version of Drupal is not supported anymore. If this is still an issue in the
8.x-1.xbranch, please open a new up-to-date ticket. Closing.