Hello guys.
Finally after looking in a lot of places just wanted to write this message that everybody else will have a quick resolution.
Let's say you want to hide the tab for certain user but still want to have this user to be able to access details of the objects - you have a problem. User for whom you hidden this tab will get an error "Warning: You do not have permission to access this module". Apparently it's known problem!!!!
There are couple of suggestions:
1. Approach of adding a new file to custom/modules/<MODULE THE SUBPANEL LOCATED IN>/Еxt/Layoutdefs/<custom_file_name>.php with following contents:
<?php
global $modules_exempt_from_availability_check;
$modules_exempt_from_availability_check['Accounts'] = 'Accounts';
?>
THIS APPROACH DIDN'T WORK FOR ME AT ALL!!!
2 Second approach - to edit main index.php - quick shortcut not upgrade safe.
Change this code:
Change to codeif (array_key_exists($currentModule, $modListHeader) ||
in_array($currentModule, $modInvisList) ||
(( array_key_exists("Activities", $modListHeader) || array_key_exists("Calendar", $modListHeader))
&& in_array($currentModule, $modInvisListActivities)) ||
($currentModule == "iFrames" && isset($_REQUEST['record'])) )
{
include($currentModuleFile);
}
else
{
echo '<p class="error">Warning: You do not have permission to access this module.</p>';
}
3. And the last but may be not least - just to add the hidden tab's module name to array $modInvisList in include/modules.php file and then run command <SUGARHOME>/index.php?module=ACL&action=install_actions if the tab you are higing is customized module.if (array_key_exists($currentModule, $modListHeader) ||
in_array($currentModule, $modInvisList) ||
(( array_key_exists("Activities", $modListHeader) || array_key_exists("Calendar", $modListHeader))
&& in_array($currentModule, $modInvisListActivities)) ||
($currentModule == "iFrames" && isset($_REQUEST['record'])) )
{
include($currentModuleFile);
}
else
{
include($currentModuleFile);
//echo '<p class="error">Warning: You do not have permission to access this module.</p>';
}
It's from the sugarcrm wiki.
You have to run this command whenever after you build the system by M.B.,
otherwise, only admin can access customized modules.
If somebody from developers will suggest more elegant way of solving the problem please feel free to add your comments.
Again thanks to Ken Brill, frankext, and antoniogc for their input - Read the articlehttp://www.sugarcrm.com/forums/showthread.php?t=2409
Yuri


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks