Results 1 to 4 of 4

Thread: Restrict access to panels(not modules) based on role

  1. #1
    shannonhamilton is offline Senior Member
    Join Date
    Jan 2009
    Posts
    21

    Question Restrict access to panels(not modules) based on role

    Any help here would be greatly appriciated.

    Ive created a few extra panels in the accounts module. What I am looking for is to be able to allow people with role of "accounting" to be able to view the "accounting details" panel.

    Anyone who is not a member of the "accounting" role should not see this panel what so ever.

    I am running:
    WinXP Pro SP3 / Sugar 5.2.2 CE full install

  2. #2
    ivolator's Avatar
    ivolator is offline Sugar Community Member
    Join Date
    Sep 2006
    Location
    Dagobah
    Posts
    98

    Default Re: Restrict access to panels(not modules) based on role

    In your custom definition file for the subpannel check for the user's allowed Role actions and if the
    user is permitted to do(or not to do stuff) unset the specific subpanel definition.
    ... That simple
    May the source be with you!

    A message from the Dark Side there is ...
    Be done in sugarcrm, no core changes should. Hmmmmmm.
    ...


    Teams For The Masses
    Video Demo of CETeams module

    SimpleCaptcha - A Captcha for SugarCRM 5.2.0x


    Password Resetting For SugarCRM CE PRO and ENT 5.2.0x

  3. #3
    shannonhamilton is offline Senior Member
    Join Date
    Jan 2009
    Posts
    21

    Default Re: Restrict access to panels(not modules) based on role

    Quote Originally Posted by ivolator View Post
    In your custom definition file for the subpannel check for the user's allowed Role actions and if the
    user is permitted to do(or not to do stuff) unset the specific subpanel definition.
    ... That simple
    So are you saying to check the users allowed role actions for the Accounts panel? I dont see how that would restrict access to the "panels" within the module Accounts. Ill look for the code and that may bring the light in the door.

    Also, for others inquiring where is this custom definition file for the subpanel located? Im assuming: htdocs\sugarcrm\custom\modules. And what would the filename be???

    Thanks for the speedy reply!
    Last edited by shannonhamilton; 2009-01-28 at 12:42 AM.

  4. #4
    ivolator's Avatar
    ivolator is offline Sugar Community Member
    Join Date
    Sep 2006
    Location
    Dagobah
    Posts
    98

    Default Re: Restrict access to panels(not modules) based on role

    ooouch...
    I just realized you are not talking about sub panels (are you? )
    Sorry! ... a little burned out here.
    Anyways... it works in a similar way.

    Your stuff should look something like ... if I was wrong the first time.
    PHP Code:
    if(!ACLController::checkAccess('Accounts''list'true)){
       unset(
    $viewdefs['Contacts']['EditView']['panels']['YOURPANEL NAME']);
    }; 
    in your meta (edit/detail)viewdefs.php data file . It should be in the custom folder too.
    BUT this file is also buried in the cache folders so after you make your changes you'll need to clear out the cache before you do anything else.
    Cache is getting recreated everytime you click on your module, so this should be part of your routing when debugging
    May the source be with you!

    A message from the Dark Side there is ...
    Be done in sugarcrm, no core changes should. Hmmmmmm.
    ...


    Teams For The Masses
    Video Demo of CETeams module

    SimpleCaptcha - A Captcha for SugarCRM 5.2.0x


    Password Resetting For SugarCRM CE PRO and ENT 5.2.0x

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 23
    Last Post: 2010-11-11, 08:31 AM
  2. Leads/Roles. Permission based access based on lead type.
    By kyhoop in forum General Discussion
    Replies: 2
    Last Post: 2008-08-18, 07:11 PM
  3. Create Role no rights access limited single few modules
    By kenlyle in forum Feature Requests
    Replies: 0
    Last Post: 2007-03-16, 02:27 PM
  4. Replies: 0
    Last Post: 2007-03-16, 01:51 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
  •