group administrator cannot add users to closed group (og_is_group_admin not checking permission "administer organic groups")

generaltao - October 22, 2009 - 15:31
Project:Organic groups
Version:6.x-2.0-rc3
Component:og.module
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

We were working on this today and could not come to a consensus on how to act on this. Here's a rough list of how we see our user type breakdown by level:

1) system administrator (administer nodes)
2) group SUPER user (to add users to different groups, all of which are closed)
3) group administrator (group admin seems intended to only add/edit/delete users and info within their assigned group)
3) normal group user

The problem is that, from what we can tell, there is no level 2 there. We have created a Group Administrator role, and assigned him the permissions for "administer organic groups" and also "edit user groups" under the oguseredit module. However, we still are not able to assign users to closed groups when logged in under those roles. There was some discussion here about it before, but it never seemed to address this very issue in the end. The root of the problem seems to stem from the granularity of the permissions, and we were able to fix it for OUR installation on this line in the og_is_group_admin function:

return og_is_group_type($node->type) && (user_access('administer nodes', $account) || !empty($account->og_groups[$node->nid]['is_admin']));

changed to

return og_is_group_type($node->type) && (user_access('administer nodes', $account) || !empty($account->og_groups[$node->nid]['is_admin']) || user_access("administer organic groups",$account));

Is this all by design? If so, how can we solve this particular problem?

#1

mani.atico - November 10, 2009 - 20:01

+1

 
 

Drupal is a registered trademark of Dries Buytaert.