Module Administrator Functionality in Sugar 5.2
Monday, December 15th, 2008A key feature in the up-coming 5.2 release for Sugar Professional and Sugar Enterprise will enable Sugar administrators to delegate more granular module control to end users. In previous versions, users needed to be marked as an “Administrator” to gain access to the Administration area of the application. This exposed ALL administration functionality to that user.
In 5.2, users can be marked as being administrators for particular modules giving them access to only relevant administration functionality. This can be done by giving users a role with its “Access Type” set to “Developer” or “Admin & Developer“. Both settings will ensure that users with that role will have access to Administration areas for that module. The “Admin & Developer” setting additionally grants the user visibility into all the records for that module (by-passing any team security that may be in place).
What exactly does a MA see?
- Upon login, a module administrator will see an “Admin” link at the top of the application (previously only available to System Administrators). This will give them access to the Administration area of the application.
- MAs of all studio-enabled modules will have access to Studio in the Administration area. In Studio, MAs will be able to modify only those modules for which they are either “Developer” or “Admin & Developer”.
- Workflow tools will be exposed and MAs can define workflows for the pertinent modules.
- Any other module specific tools in the Administration area will be exposed (e.g. A “Developer” for the Products module will see the Products related tools, etc.).
Enabling MA functionality for your custom modules
Custom modules can take advantage of this feature quite easily. Any new Administration tools should be added to the following file:
custom/modules/Administration/Ext/Administration/administration.ext.php
in the following format:
<?php $admin_option_defs=array(); $admin_option_defs['Administration']['MyModulesLink']= array($imagePathForLink,$labelForLink,$descriptiveLabelForLink,$URLforLink); $admin_group_header[]= array($labelForTheNewGroup,'',false,$admin_option_defs, $descriptiveLabel); ?>
In this example, the link will ONLY be available to System Administrators. To enable access for MAs, you’d specify the module name as follows:
$myModuleName = $customPkgName.'_'.$moduleName; $admin_option_defs[$myModuleName]['MyModulesLink']=...
OOB examples of this construct are located at
/modules/Administration/index.php
API Change Affecting all Editions
While this new feature is available only in Sugar Professional and Sugar Enterprise, the code for defining sections in the Admin screen has changed in 5.2 for all editions of Sugar including the Community Edition. The $admin_option_defs[] array is now a two-dimensional array as described above where in previous releases it was a one-dimensional array. The two-dimensional array now defines both the module section and the entry key for a given Admin screen entry instead of just the entry key.
Developers who built customizations around the Admin screen will need to modify their code appropriately.