Limit Groups in Outline to just those a user is admin in

SomebodySysop - August 30, 2008 - 01:34
Project:Subgroups for Organic groups
Version:5.x-4.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

In my implementation, a major problem in og_subgroups_outline is the fact that it returns virtually all og subgroups. This is not a problem with the og_subgroups.module in general since in core Drupal a user must have role to "edit group hierarchy" applied sitewide.

However, in OG User Roles, where a user can be given the "edit group hierarchy" role in one group only, this becomes a major problem.

I'm submitting a patch here which not only solves this problem for OGUR, but also adds a pretty neat feature to the og_subgroups.module: An option is provided in og_subgroups settings to limit the groups that will appear in the subgroups "Parent" pulldown menu to groups that the user is an administrator in.

So, og_subgroups works as it normally does by default. But, there would now be an option to make sure that users could only include groups that they are administrators for in their group hierarchies. And, OGUR is NOT required to use the new feature.

Hope you agree that it's a good idea, and it works.

AttachmentSize
og_subgroups.module.admin_.patch2.15 KB

#1

Amitaibu - August 30, 2008 - 07:16
Status:active» needs work

In D6 we rely on book module, which takes care of the hierarchy and access, how would you do it do D6? Although the feature sounds good, I will add it only if it can exist in D6 as well.

About the patch, few remarks, haven't tested yet:
1. Add a variable_del('og_subgroups_admin') in the install file.
2. Instead of the query in line 34, maybe load the $user and check which groups he admins. I prefer not to query other modules tables.
3. There is is tab in line 36.

#2

ezra-g - November 15, 2008 - 21:49

Thanks for this contribution. Could this patch be relevant to the d6 version?

#3

ezra-g - November 15, 2008 - 21:49

by patch, I really mean feature request.

 
 

Drupal is a registered trademark of Dries Buytaert.