When an Administrator of an Organic Group with the proper permissions creates a Webform, access is denied to the Form Components and Results. Organic Groups User Roles 4.0 provides content access control. Content Access is not installed.
The webform is published, and the node_access table is properly configured as explained: http://drupal.org/node/226987 .
Content Access Permissions were rebuilt, cron was run, and all caching was turned off and the caches cleared.
And the Authenticated User is one of the "Roles that can submit this webform: "
When the Authenticated User is given the same permissions as the Administrator, then the Webform can be accessed by both the OG Adminsitrator and the Authenticated User, but then, of course, it can be edited by any authenticated user which violates the security policy and general use case.
OGUR and OG have also assigned the roles properly:
print_r($user);
[roles] => Array
(
[2] => authenticated user
[3] => Admin
[4] => GroupMember
)
Can this code provide a fix for Drupal 6.15 and OGUR 4.0? Or other scenarios?
http://drupal.org/node/226987#comment-2366800
Thanks very much.
Comments
Comment #1
quicksketchIs OG User Roles part of OG? I've used OG just fine with Webform in the past. I don't think that the link you posted to is going to help any.
Comment #2
noderunner commentedOGUR is an additional module that lets you assign roles to users in the group context. There are two versions for 6.x.: OGUR 1.5 is feature rich but OGUR 4.0 is simplified with almost all features stripped except the definition of roles for the group member and the administrator.
How do I troubleshoot this problem? What information can I provide?
Comment #3
noderunner commentedSame problem with OGUR 1.5. Edited issue title to correspond.
Tested on separate installation from OGUR 4.0 .
Comment #4
noderunner commentedquicksketch, you were right. The code I referenced did not add the "view" permission in 6.15. Perhaps it was for 5.x. I even tried adding the $account parameter.
I'm a bit out of my depth here, but I have a deadline next week, and unfortunately for me, this was a top 5 feature for the site. It's going to be interesting to say the least. ;-) Yikes!
For anyone interested:
http://drupal.org/node/226987#comment-2366800
Thanks
Comment #5
noderunner commentedHere are the webform permissions for the different roles in the 'permission' table:
Admin:
access own webform submissions, access webform results, clear webform results, create webforms, edit own webform submissions, edit own webforms, edit webform submissions, edit webforms
Group Member:
access own webform submissions, edit own webform submissions
authenticated user:
access own webform submissions, edit own webform submissions
Comment #6
noderunner commentedIn hope of a workaround, as suggested in a forum post, I installed Content Access on a demo box with Webform, Organic Groups, and OG User Roles 4.0.
It shows that the webform permissions for the group admin role do not appear for webform content. The permissions for the the other content types like Poll do show in Content Access.
As well, the OG Details Block does not show the "Create Webform" for the Admin role. It does show "Create Webform" when the permission is given to the authenticated user role.
I'm really reluctant to pursue this as a workaround, though. I selected OGUR 4.0 rather than OGUR 1.5 in the interest of speed and simplicity. I plan to add a WYSIWG editor later, and that should make things difficult enough for troubleshooting.
I added the OG Admin and OG Member roles to Access Control for the Webform content type, but it still doesn't work. All of the other content types work.
Comment #7
noderunner commentedComment #8
noderunner commentedContent Access didn't change any of the behavior.
What information is needed for troubleshooting beyond what has been provided?
Comment #9
noderunner commentedChecked the webform_roles table and everything seems to correspond to the "Roles that can submit this webform:".
What can else can be checked to troubleshoot?
Comment #10
noderunner commentedIs there a weight I need to change in the database?
Comment #11
noderunner commentedThe Devel module for node_acces entries appears on the "View" tab of the node, but it disappears when I try to see what is happening on "Edit"
Here the permissions are still set to allow the unauthenticated user full permissions for the webform. Otherwise, the "Edit" tab would not be visible at all.
Also, the the node_access block does not appear for any user other than admin even when the block is configured to be visibile to other roles. Is that normal behavior?
Comment #12
noderunner commentedI changed the webform module weight in the system table to -2 since og_user_roles was -1. No change in behavior.
Changing back to -1.
Comment #13
noderunner commentedWhen the admin user is logged in, there appears to be a callback for 'node/10/edit/components" where 10 is the the webform node. How can I see what query is made for the OG Admin user? The Devel node_access block disappears from the authenticated user even when it is configured to be displayed.
Is that the right terminology?
0.25 1 og_user_roles_menu_get_item SELECT * FROM menu_router WHERE path IN ('node/10/edit/components','node/10/edit/%','node/10/%/components','node/10/%/%','node/%/edit/components','node/%/edit/%','node/10/edit','node/10/%','node/%/edit','node/%/%','node/10','node/%','node') ORDER BY fit DESC LIMIT 0, 1
Comment #14
noderunner commentedThe devel module is set properly now and the node_access block shows that somehow the group context or role assignment breaks from "Edit" to "Form Components"
username create view update delete
user NO: by the module YES: node access NO: node access NO: node access
admin YES: administer nodes YES: administer nodes YES: administer nodes YES: administer nodes
Roles from print_r($user); for "Edit":
[2] => authenticated user
[3] => Admin
[4] => GroupMember
Roles from print_r($user); for "Form Components":
[2] => authenticated user
Comment #15
noderunner commentedTried altering module weights in the system table of a demo box separate from the one above. No change in behavior.
OGUR -2
webform -1
og 0
OGUR -2
OG 0
webform 1
Comment #16
noderunner commentedOn a separate VM, I tried changing the 'acccess callback' for:
node/%webform_menu/edit/components
node/%webform_menu/edit/components/%webform_menu_component
node/%webform_menu/edit/components/%webform_menu_component/clone
node/%webform_menu/edit/components/%webform_menu_component/delete
to . . .
'access callback' => TRUE,
Saved the file, restarted MySQL and Apache. Disabled and enabled the Webform module. Toggled permissions.
Strangely, no change in behavior, at all.
Comment #17
sunThe cause of this may be that the local tasks of Webform do not have OG's query string (?gid=...), so there is no group context, and if there is no group context, OGUR won't do anything.
Not sure which issue to mark as duplicate, this or #689454: Access denied to Webform
Comment #18
noderunner commentedSun, thanks for taking a look.
I suppose when we find which module has the bug or code that is easiest to change, we can mark the other as a duplicate. I just wanted to make the bug visible to both groups.
Comment #19
quicksketchI'll make any changes necessary to Webform to get this fixed, but I won't be spending time getting OGUR up and running just to test it out. I'll mark this one postponed, I'd suggest continuing in #689454: Access denied to Webform unless a patch needs to be applied on the Webform side.
Comment #20
noderunner commentedquicksketch, I already have a server setup for you with the debug module. Want to take a look?
I'd be glad to give you root access.
Thanks for your consideration.
Comment #21
quicksketchNo, I'm not interested in debugging a module I've never used, which is likely more responsible for the problem. I can't afford to maintain any modules than I have already.
Comment #22
sun.core commentedThanks for taking the time to report this issue.
However, marking as duplicate of #689454: Access denied to Webform.
You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.