Results 1 to 2 of 2

Thread: How to view only my emplyees

  1. #1
    piccirm2 is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    65

    Default How to view only my emplyees

    Hi

    any user can view all employees data
    How can I restrict this so that a user can view only employess that reports to him ???

  2. #2
    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: How to view only my emplyees

    Hi, piccirm2

    You can create a logic_hook after retrieve in Users which can modify the $_REQUEST forcing the ListView search.
    This ListView search could add the field reports_to with the $current_user->id as value.
    Additionally you can create a view.detail.php and view.edit.php which only display the record if the chosen employee reports to the $current_user

    Cheers
    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. Replies: 23
    Last Post: 2010-11-11, 08:31 AM
  2. Replies: 24
    Last Post: 2008-08-20, 08:19 PM
  3. Replies: 13
    Last Post: 2007-10-04, 05:53 AM
  4. Replies: 0
    Last Post: 2007-08-09, 06:34 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
  •