Results 1 to 4 of 4

Thread: User Restrictions

  1. #1
    vijay9948 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    56

    Default User Restrictions

    How can i restrict the users for not showing other users records(User has to see his records only)

    how can i use after_retreive event for this

    Pls help me pls pls

  2. #2
    mvngti is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    South Africa
    Posts
    510

    Default Re: User Restrictions

    You can create an after_retrieve logic hook with code like this:

    PHP Code:
    global $current_user;
    if (
    is_admin($current_user))  return;  // Always allow admin

    if ($current_user->id != $bean->assigned_user_id)
       
    $bean->id NULL;   // Shows can not retrieve ... 
    You can find more info on using the logic hooks in the DEV manual here
    http://developers.sugarcrm.com/docs/...e_5.1-toc.html
    --


    Marnus van Niekerk

    There are only 10 types of people in the world
    those who can read binary and those who don't

    Modules:
    CE Teams - Upgrade safe teams module for Community Edition
    FieldACL - Field Level Access Control for Community Edition
    EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
    FlexibleChartDashlet - Display any data in a Dashlet Chart
    DocumentThumbnails - Thumbnails for Documents module

    Many questions can be answered by reading the Developers Manual

  3. #3
    vijay9948 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    56

    Default Re: User Restrictions

    Thank u for ur Reply

    Regards



    Vijayabhaskar reddy

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: User Restrictions

    The best solution is to create the controller for the custom module and define the methods action_detailview and action_editview.


    PHP Code:
    global $current_user;

    if(! 
    is_admin($current_user) && $current_user->id != $bean->assigned_user_id)  {
        
    $this->view 'noaccess';

    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. User with restrictions
    By ashashivam in forum Installation and Upgrade Help
    Replies: 5
    Last Post: 2008-04-09, 12:20 PM
  2. Export Restrictions
    By marketadvantage in forum Developer Help
    Replies: 2
    Last Post: 2007-10-05, 02:04 PM
  3. Restrictions on notes and appointments?
    By Hof in forum Feature Requests
    Replies: 0
    Last Post: 2006-05-27, 07:47 AM
  4. Campaign Emails and your ISP's restrictions
    By CyberFerret in forum Marketing/Campaign Management
    Replies: 0
    Last Post: 2006-03-04, 12:43 AM
  5. Users Restrictions
    By gianni in forum Help
    Replies: 5
    Last Post: 2005-10-06, 06:21 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
  •