Add "Manager of the current group" to Group nodes validator
| Project: | Organic groups |
| Version: | 6.x-2.0 |
| Component: | Og Views |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | fixed |
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
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.#2
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.
#3
The patch #602754-1: Add "Manager of the current group" to Group nodes validator works for me. Nice
#4
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
I'd agree seems pretty robust to me... is there a date for DEV/Formal release inclusion within OG/OG Views?
#6
Is there a D6 feature freeze on for OG?
#7
This has been working flawlessly in a few separate sites in our dev environments.
#8
Any word on this? This functionality is solid, and has been working cleanly for a while now.
#9
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
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
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
(Thanks for committing this!)
#13
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
The first comment on #639294: More granular argument validation for OG Group Nodes contains the patch for the additional feature mentioned above.