Results 1 to 4 of 4

Thread: Modules and roles...

  1. #1
    ajlisowski is offline Sugar Community Member
    Join Date
    Jul 2010
    Posts
    56

    Default Modules and roles...

    Hey all, if I restrict certain module features to certain roles, is there a way for those links to not show up for them at all? Like if a user cant create a new object of that module I dont want the create button even shown for them. Is this possible with config or will I need to edit some custom templates/layouts?

  2. #2
    ajlisowski is offline Sugar Community Member
    Join Date
    Jul 2010
    Posts
    56

    Default Re: Modules and roles...

    Another instance of googling a bit more after asking has solved this for me.

    In case anyone is wondering you have to edit/add a file.

    custom/modules/MODULE_NAME/Ext/Menus/menu.ext.php

    $module_menu=array();

    putting this at the top kills the current actions list.


    if(ACLController::checkAccess('MODULE_NAME', 'edit', true)) {
    $module_menu[]=Array("index.php?module=MODULE_NAME&action=EditVi ew&return_module=MODULE_NAMEt&return_action=Detail View",'Create Script', "Create Script");
    }

    this line will check to see if the user has access to the module action and if so display it. Do this for any/all your actions. Done and done.

    Not sure why thats not automatic for modules. If someone doesnt have access I likely dont want them clicking or even seeing the link. Oh well.

  3. #3
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Modules and roles...

    Hello,

    The correct place to change the Menu is custom/Extension/modules/<MODULE_NAME>/Ext/Menus/FILE_NAME.php otherwise by doing quick repair and rebuild you will loose the customization.
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  4. #4
    ajlisowski is offline Sugar Community Member
    Join Date
    Jul 2010
    Posts
    56

    Default Re: Modules and roles...

    Ohh.

    does it matter what the file name is? Or will the quick repair merge all the files in that menu directory?

    If it does matter, what should the name be? Menu.php?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 2009-10-13, 02:47 PM
  2. Disabling Modules via Roles
    By cpscdave in forum Help
    Replies: 17
    Last Post: 2009-01-06, 10:02 PM
  3. relating roles with other modules?
    By labanjohnson in forum Feature Requests
    Replies: 2
    Last Post: 2008-10-27, 11:48 PM
  4. Replies: 0
    Last Post: 2006-03-23, 02:50 AM
  5. Roles-Contacts and Roles-Accounts
    By jmontani in forum Developer Help
    Replies: 0
    Last Post: 2005-07-20, 08:35 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
  •