Add "Manager of the current group" to Group nodes validator

marcp - October 12, 2009 - 22:33
Project:Organic groups
Version:6.x-2.0
Component:Og Views
Category:feature request
Priority:normal
Assigned:Unassigned
Status:fixed
Description

This is related to #576298: Access plugin: Member of the current group and the (flawed, I think) OG Views Extra module that it spawned.

I'd like to set the access control on a view such that it only appears for a group manager. I think the code to do this is going to belong in an argument validator, probably og_views_plugin_argument_validate_og_group_types.

Is there another way to do this? Would a patch for this functionality have a chance to be accepted into OG? If so, for the UI, should the current "Validate current user is a member of a specified group" checkbox be changed to radio buttons with corresponding values:

0. Do not validate user's group membership
1. Validate current user is a member of a specified group
2. Validate current user is a manager of a specified group

#1

marcp - October 13, 2009 - 05:11
Status:active» needs review

The attached patch:

1. Changes the "Validate current user is a member of a specified group" checkbox to a select with the three options specified above. It maintains the "1" value for validating that the current user is a member of the specified group, so there isn't any need for an update function.

2. Refactors out the check on $this->argument->options['validate_argument_is_member'] into a helper member function.

AttachmentSize
og-issue-602754.patch 3.84 KB

#2

bonobo - October 14, 2009 - 00:11

This has been working well in our dev environment -- here is some background info, with screenshots, on the specific use case this supports --

We need to create a set of options that are only available to group admins. These options included some things covered within OG (like sending emails) and some things not currently covered in OG (like resetting pw's for people in the group).

This argument handler patch works with Views Bulk Operations to allow group admins to be given some pretty granular rights to administer users within their groups.

1. The first screenshot shows the additional option created by this patch:

2. The screenshot below shows how to configure the views argument to access this functionality:

3. The third screenshot, below, shows the view that gets created:

4. The final screenshot shows the view with the options we selected:

So, this patch allows folks to create a wide range of more granular administrative controls for group admins.

AttachmentSize
validator_options.jpg 38.14 KB
config_with_new_arg_handler.jpg 94.01 KB
main_page.jpg 69.67 KB
group_admin_operations.jpg 40.43 KB

#3

snorkers - October 15, 2009 - 21:29

#4

bonobo - October 16, 2009 - 18:11
Status:needs review» reviewed & tested by the community

We have been testing this in a few different scenarios, and it has worked without issue.

Changing status -- while some more eyes on this would be nice, we have hammered on it pretty well over the last few days.

#5

snorkers - October 16, 2009 - 21:21

I'd agree seems pretty robust to me... is there a date for DEV/Formal release inclusion within OG/OG Views?

#6

marcp - October 24, 2009 - 13:52

Is there a D6 feature freeze on for OG?

#7

bonobo - November 3, 2009 - 18:42

This has been working flawlessly in a few separate sites in our dev environments.

#8

bonobo - November 13, 2009 - 18:27
Version:6.x-2.x-dev» 6.x-2.0

Any word on this? This functionality is solid, and has been working cleanly for a while now.

#9

marcp - November 19, 2009 - 05:40
Title:Access plugin: Manager of the current group» Add "Manager of the current group" to Group nodes validator

Wondering whether this has a shot at getting into the next OG release.

I'm considering adding an additional bit of validation to the Group nodes validator so the view designer can choose the Group node types that are allowed. This would be analagous to the list of types in the Node validator, only the list would be limited to group node types.

Just give me the word and I'll close this issue out and maintain the patch on my own, but I suspect this will be useful functionality for someone else out there.

#10

moshe weitzman - November 20, 2009 - 00:17

Nice code, and very nice screenshot essay by bonobo. Thats one of the finest advocacy pieces i've seen in the queues.

Committed to 6--2.

Sorry for the delay in replying on this issue. I'm kinda burnt out on OG. I'm transitioning OG maintainership to Amitaibu. He's already done a fantastic rewrite for D7. I'm not sure yet if he will be maintaining the D6 branch as well. If not, I'll be looking for a D6 maintainer as well.

#11

marcp - November 20, 2009 - 00:23

Bonobo and Marcp close in on Moshe. This could be ugly. Moshe laterals to Amitaibu! Bonobo and Marcp collide -- ouch, that's gotta hurt! Amitaibu is headed down field ... TOUCHDOWN AMITAIBUUUUUUUUUUUUUUUUUU!!!

#12

marcp - November 20, 2009 - 00:25

(Thanks for committing this!)

#13

bonobo - November 21, 2009 - 00:58
Status:reviewed & tested by the community» fixed

Setting to fixed --

Thanks for the commit!

We will likely have an additional patch based on #9: "I'm considering adding an additional bit of validation to the Group nodes validator so the view designer can choose the Group node types that are allowed."

We'll open a separate issue for that.

#14

marcp - November 21, 2009 - 19:07

The first comment on #639294: More granular argument validation for OG Group Nodes contains the patch for the additional feature mentioned above.

 
 

Drupal is a registered trademark of Dries Buytaert.