Closed (fixed)
Project:
Spaces
Version:
6.x-2.0-beta3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Sep 2008 at 21:08 UTC
Updated:
1 Aug 2009 at 17:14 UTC
This is related to http://drupal.org/node/280975 and is basically the missing part. If a user is creating a new group, they'll be unable to do so because the group path and group privacy fields will be disabled, if they do not have the 'administer group features' perm, and if they have the 'administer group features' perm they're able to edit the settings of groups they should not be able to edit.
Can't we just rip these access checks out completely (the ones shown below on the form elements) and just base it on whether the user can create group nodes or not? If not, here's a possible patch:
-
+
+ if (($form['#node']->nid && og_is_node_admin($form['#node']->nid)) || (!$form['#node']->nid)) {
+ $disabled = FALSE;
+ }
+ elseif ($form['#node']->nid && !og_is_node_admin($form['#node']->nid)) {
+ $disabled = TRUE;
+ }
+
$form['spaces_path'] = array(
'#type' => 'textfield',
'#title' => t('Group Path'),
'#description' => $description,
'#required' => true,
- '#disabled' => user_access('administer group features') ? false : true,
+ '#disabled' => $disabled,
'#default_value' => spaces_group_path($form['#node']->nid) ? spaces_group_path($form['#node']->nid) : '',
);
@@ -261,7 +268,7 @@
'#options' => spaces_groupmask('labels'),
'#description' => t('<strong>Private</strong> groups are invisible to the public and accessible only by members.<br/><strong>Controlled</strong> groups are visible to the public, but cannot be joined without approval.<br/><strong>Public</strong> groups are visible to the public and can be joined by site members.'),
'#default_value' => $default_privacy ? $default_privacy : 'private',
- '#disabled' => user_access('administer group features') ? false : true,
+ '#disabled' => $disabled,
);
$form['#after_build'][] = 'spaces_group_after_build';
}
Comments
Comment #1
Ian Ward commentedI just found one other issue that is related to the above, and figured to post it here b/c it's directly related. If a user makes a new group node, and they do not have 'administer group features' access, then they get a 403 page after making the group. This is just a small change needed, to say that the user should have either 'administer group features' OR be the author of the group.
Comment #2
rsoden commentedThis looks good. Pls commit.
Comment #3
yhahn commentedThese two elements are no longer access controlled. Closing.