Set perms on settings submit and improve documentation

Bevan - February 13, 2008 - 09:12
Project:Admin Role
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

This patch changes adminrole so that permissions are also set when the admin settings form for Admin Role is submitted. It also adds to documentation of functions and in the interface, and tidies up whitespace for better code readability.

AttachmentSize
adminrole_update_perms_on_settings_submit.patch2.54 KB

#1

JacobSingh - February 14, 2008 - 08:24

Thanks Bevan!

I noticed one small bug though, you were referencing the wrong form_id when setting the callback.

Re-rolled the patch.

One problem though is that when switching roles, you really end up with two admins. We should probably remove the previous role's perms when a switch is made... what do you think?

AttachmentSize
adminrole_update_perms_on_settings_submit_v2.patch 1.32 KB

#2

Bevan - February 14, 2008 - 21:04

Ah! Yes. I later realized that I had not tested it properly and my patch wasn't in fact even working!

I rerolled my patch with the one functional difference between your and my patches:

-  if (in_array($form_id, array('system_modules', 'adminrole_update_perms'))) {
+  if (in_array($form_id, array('system_modules', 'adminrole_admin_settings'))) {

In your patch you had reverted a bunch of minor documentation and whitespace changes that I made.

AttachmentSize
221124.patch 2.96 KB

#3

JacobSingh - June 25, 2008 - 11:56
Status:needs review» patch (to be ported)

Thanks! Finally in.

#4

JacobSingh - June 25, 2008 - 12:09
Status:patch (to be ported)» fixed

#5

Anonymous (not verified) - July 9, 2008 - 12:15
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.