Download & Extend

Set perms on settings submit and improve documentation

Project:Admin role
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

AttachmentSizeStatusTest resultOperations
adminrole_update_perms_on_settings_submit.patch2.54 KBIgnored: Check issue status.NoneNone

Comments

#1

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?

AttachmentSizeStatusTest resultOperations
adminrole_update_perms_on_settings_submit_v2.patch1.32 KBIgnored: Check issue status.NoneNone

#2

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.

AttachmentSizeStatusTest resultOperations
221124.patch2.96 KBIgnored: Check issue status.NoneNone

#3

Status:needs review» patch (to be ported)

Thanks! Finally in.

#4

Status:patch (to be ported)» fixed

#5

Status:fixed» closed (fixed)

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