Closed (works as designed)
Project:
OG User Roles
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Apr 2009 at 21:16 UTC
Updated:
31 Jul 2009 at 04:12 UTC
Hello,
I am rather desperate to use OG user roles with Views such that I limit access to views and particular views fields based on OG user roles. It doesn't work. Is that expected? Or is there something wrong with my setup? I've tried over the course of several versions of the OG user roles and OG and Views, so I'm filing this as a bug report as it seems to always consistently not work.
Thank you!
Comments
Comment #1
i.chris.jacob commentedHi Sammos,
I have a similar issue. But this is not a bug. This is how the modules is intended to work. To my understanding OGUR assigns roles which are only upheld while the user is within what I call 'group-scope' (e.g. og/something pages). Outside of this scope the Group Roles don't apply, Sitewide Roles are what apply. This may help: http://drupal.org/node/343354 (but it's a bit cryptic)
Try reading my recent Feature Request...
Assign 1 or more Sitewide Roles upon joining a particular group.
http://drupal.org/node/441346
Hope that helps
Comment #2
somebodysysop commentedYes, this is correct. OGUR only works in group context. So, in order for a user's group role permissions to have effect within a view, the view must be in group context.
Comment #3
lelizondo commentedI am probably going to say something really stupid.
1. The context of a view is determined with the argument, if I use groups/%/stories as the view path the argument will pass and views will filter the stories for the current group. The inconvenient with this is that you can't use tabs menus, you have to go to node/%/stories (different story).
I know the context is preserved since running:
gets the correct Group ID.
2. I've been reading thought the code of 6.x-4.x version of this module (here comes the stupid comment) and I think the problem is with OGUR since is not checking somehow the context properly when we're on a view and is not assigning the roles because it lacks of a context. I think the problem is with og_user_roles_determine_context() since it checks for the context on only nodes, comments, and the frontpage and not when it finds the argument.
Also, changing the path to something like og/%/something didn't work for me.
Am I right, or I just said something really stupid and there's no workaround for this?
Comment #4
lelizondo commentedIt wasn't that stupid at all. OG and OGUR didn't have a context when on a view. I applied the patch here http://drupal.org/user/440632 and is working great. I had to do it manually and apply it both to OG and OGUR. Is not that hard.
Comment #5
sunThis may apply to 1.x, but definitely not to 4.x.
And since SomebodySysop already marked it as by design, I'm reverting the status.
Comment #6
lelizondo commentedit does apply for 1.x and 4.x, works with both, I can confirm that.
The only problem is that version 4.x does not include the 'clear cache' option to flush the permissions and I'm having the access denied problem when trying to add a node.. so I downgrade to 1.x again.. I've been reading about this problem but I can't find the cause, is it another 'og family' module? which one?