"Show groups even when user is not a member" not showing groups even when user is not a member

jsheldon - March 2, 2009 - 22:54
Project:Simple Access
Version:6.x-2.0-rc1
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

Using both 5.x-1.3 with a live system and 6.x-2.0-rc1 on a brand new test installation of Drupal, defined groups don't show under a node's "Access" listing if a user isn't in some way a member. Rather, only the groups show up that the user is a member of. This is the case whether or not "Show groups even when user is not a member" is selected under admin -> site configuration -> simple access. "View" and "Edit" fields are enabled and show up properly under Access for the allowed groups. Everything showed up fine in versions v4 and also in v5 HEAD (datestamp = "1182212603") when "Show groups..." was checked.

I'm trying this under Drupal 5.15 and 6.10 on a Debian Linux system with Apache2.

#1

jsheldon - March 26, 2009 - 04:59
Version:5.x-1.3» 6.x-2.0-rc1
Component:User interface» Code
Priority:normal» critical

It turns out that simple_access.module reveals the various group access levels only to node administrators. My co-worker, Bogdan Oporowski, made the following changes (diffed from the original simple_access.module and his modified version) in order to reveal group access levels to those who are permitted to assign access to nodes:

454c454,456
< $form['sa']['simple_access'][$gid] = simple_access_form_row($gid, $group, $node->simple_access, $admin);
---
> if($group['access'] || variable_get('sa_showgroups', 0)) {
> $form['sa']['simple_access'][$gid] = simple_access_form_row($gid, $group, $node->simple_access, $admin);
> }
470c472
< $priv = $group['access'] || user_access('administer nodes');
---
> $priv = $group['access'] || user_access('assign access to profiles') || user_access('assign access to nodes') || user_access('administer nodes');

 
 

Drupal is a registered trademark of Dries Buytaert.