View Full Version : Default admin permissions?
alcazarx
10-04-2014, 01:29 PM
Hello Folks,
another small question.
Normally if you edit an administrators permissions, its all set to "No" (if its a new record).
Is there a plugin/option/whatsoever to set this to predefined values? (i. e. see attachment)
Me know that the free software MyBB (boo!) has an "default group permissions" option for this, but we dont need this, since our admins have (mostly) the same permissions.
All we could found in the code is, that when editing an administrator an "empty" record with only the user_id is created in the "administrator" table.
Thanks.
ozzy47
10-04-2014, 01:32 PM
No, it was designed that way as most owners might want to assign different permissions to different admins. :)
It should not take long at all to set up, also it's not like you are adding new admins every ten minutes.
tbworld
10-04-2014, 08:03 PM
All we could found in the code is, that when editing an administrator an "empty" record with only the user_id is created in the "administrator" table.
Thanks.
Administrator permissions are held in table 'administrator' column 'adminpermissions' as a bit field. You could easily create a query to copy the bit field from one 'userid' to another or handle it manually. Like @Ozzy47 said it is not something you will do every day, but I get the headache. :)
Please backup your database. :)
alcazarx
10-05-2014, 08:35 AM
Why not creating a plugin then ozzy? :rolleyes:
You did many great plugins here (some we use too)...
@tbworld: You could do also with changing the "default" value of the field, but we didnt want to manipulate the database.
But your idea of "copying the bitfield" lead to the simple solution, thanks.
Simple, but working solution:
Since the "adminpermissions" field is 0 for new admins, just check for it and set the desired value (15605220 for us) before the foreach (convert_bits_to_array(...))
{
print_yes_no_row(...);
}block. So all permissions that they should have are set to "Yes" then :cool:
Background: Of course its not something you do every day, but there is (how do you say in US?) "reorganization in progress" and a merge with another community (they had a different script) so there will be a new "org chart" then :p .In the end there will be only 2 people with "$config['SpecialUsers']['superadministrators']" so the change above will be removed afterwards.
Thanks, can be closed like the other thread.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.