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.

Comments

JacobSingh’s picture

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?

Bevan’s picture

StatusFileSize
new2.96 KB

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.

JacobSingh’s picture

Status: Needs review » Patch (to be ported)

Thanks! Finally in.

JacobSingh’s picture

Status: Patch (to be ported) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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