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

quicksketch’s picture

Priority: Critical » Normal

Is 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.

noderunner’s picture

OGUR 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?

noderunner’s picture

Title: Weform Access Denied With 6.15 and OGUR 4.0 » Weform Access Denied With 6.15 and OGUR 4.0 and 1.5

Same problem with OGUR 1.5. Edited issue title to correspond.

Tested on separate installation from OGUR 4.0 .

noderunner’s picture

quicksketch, 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

noderunner’s picture

Here 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

noderunner’s picture

In 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.

noderunner’s picture

Issue tags: +user roles, +Organic Groups, +webform, +ogur
noderunner’s picture

Content Access didn't change any of the behavior.

What information is needed for troubleshooting beyond what has been provided?

noderunner’s picture

Checked 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?

noderunner’s picture

Is there a weight I need to change in the database?

noderunner’s picture

The 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"

node_access entries for nodes shown on this page
node prio status realm gid view update delete explained 
node prio status realm gid view update delete explained 
10 0 ok content_access:
all 0 1′ 0 0 All users may view this node. 

(Some of the table elements provide additional information if you hover your mouse over them.)
admin has the administer nodes permission and thus full access to all nodes.
  
Anonymous has the following access to node 10: 
•create: NO: The 'webform' module (which defines the 'webform' content type) denies this.
•view: YES: Node access allows this.
•update: NO: Node access denies this.
•delete: NO: Node access denies this.
(For per-user access permissions enable the second DNA block.)

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?

noderunner’s picture

I 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.

noderunner’s picture

When 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

noderunner’s picture

The 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

noderunner’s picture

Tried 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

noderunner’s picture

On 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.

sun’s picture

The 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

noderunner’s picture

Sun, 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.

quicksketch’s picture

Category: bug » feature
Status: Active » Postponed

I'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.

noderunner’s picture

quicksketch, 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.

quicksketch’s picture

No, 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.

sun.core’s picture

Status: Postponed » Closed (duplicate)

Thanks 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.