Results 1 to 2 of 2

Thread: "You don't have permissions to access this module" after hiding tab.

  1. #1
    yuri.gelman is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    45

    Default "You don't have permissions to access this module" after hiding tab.

    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:

    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
    {
    echo '<p class="error">Warning: You do not have permission to access this module.</p>';
    }
    Change to code

    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>';
    }
    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.
    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

  2. #2
    arun_raja is offline Senior Member
    Join Date
    Nov 2009
    Posts
    21

    Default Re: "You don't have permissions to access this module" after hiding tab.

    Hi,

    Take a look at this link.. http://www.sugarcrm.com/forums/showthread.php?t=54317. Instead of portal chk for the module name and the user and change the code accordingly.. I hope that it will help u out..

    Thanks
    Arun.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 19
    Last Post: 2010-10-07, 03:26 PM
  2. Replies: 4
    Last Post: 2008-08-07, 12:45 PM
  3. Replies: 3
    Last Post: 2007-10-05, 06:54 PM
  4. Replies: 9
    Last Post: 2006-11-20, 01:51 PM
  5. Replies: 2
    Last Post: 2006-02-16, 12:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •