Results 1 to 8 of 8

Thread: Non-admin users unable to edit existing accounts, opportunities, contacts, etc

  1. #1
    badmin is offline Junior Member
    Join Date
    Feb 2009
    Posts
    4

    Default Non-admin users unable to edit existing accounts, opportunities, contacts, etc

    Sugar Version : 5.2.0a (Build 5447)
    Sugar Edition: CE
    Category: Accounts, Opportunities, Leads, Contacts
    Operating System: CentOS 5.x (2.6.18-8.1.6.el5 #1 SMP Thu Jun 14 17:46:09 EDT 2007 i686 i686 i386 GNU/Linux)
    PHP Version (e.g. 4.3.11, 5.1.2)
    Database: mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i686) using readline 5.0
    Web Server: Apache/2.2.3 (CentOS)


    I am unable to edit accounts, leads, contacts, and opportunities when logged in as a non-admin user. For example, if I log in as a non-admin user and select an existing account from the listview and then click "Edit", it looks like when I click the "Edit" button on the DetailView page it attempts to go to the EditView but immediately redirects back to DetailView.

    I'm not using roles. I am using Teams CE.

  2. #2
    stevec is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,100

    Default Re: Non-admin users unable to edit existing accounts, opportunities, contacts, etc

    Sounds like a teamsCE thing - best bet may be to ask the author. But a guess would be that you have created the records as an admin and the default is to set the record's team membership to an admin-type team rather than the global-type team.

    I'm bring a bit vague with the names as I don't use teamsCE - but the problem sounds like what would happen in sugar PRO with it's own teams subsystem if the creating user's default team is set to private rather than global. In that case, the record is saved so that only that team's members can access it. Whereas, using global allows everybody.

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

    Default Re: Non-admin users unable to edit existing accounts, opportunities, contacts, etc

    You will need to give me some more info to work with but it sounds like CE Teams is redirecting you back to DetailView. This is quite strange because the same logic that restricts the EditView should also restrict the DetailView.

    Which team is the record assigned to? Is the current user a member of that team? etc. etc.

    M
    --


    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

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

    Default Re: Non-admin users unable to edit existing accounts, opportunities, contacts, etc

    PS: Are you using Teams CE (an alpha follow up of TeamsOS) or my CE Teams module?
    --


    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

  5. #5
    badmin is offline Junior Member
    Join Date
    Feb 2009
    Posts
    4

    Default Re: Non-admin users unable to edit existing accounts, opportunities, contacts, etc

    Quote Originally Posted by mvngti View Post
    You will need to give me some more info to work with but it sounds like CE Teams is redirecting you back to DetailView. This is quite strange because the same logic that restricts the EditView should also restrict the DetailView.

    Which team is the record assigned to? Is the current user a member of that team? etc. etc.

    M

    I didn't realize there is a Teams CE and a CE Teams. Yes, I'm using your "CE Teams" version 0.98.12338. And, yes the record is assigned to the same team as the user trying to edit it, and additionally the record is assigned to that user.

    So, User A is a member of Team X.
    The record R is assigned to Team X and record R is assigned to User A.
    User A is a non-admin user.
    User A cannot edit record R.
    Other members of Team X cannot edit record R.
    Admin can edit record R.

  6. #6
    badmin is offline Junior Member
    Join Date
    Feb 2009
    Posts
    4

    Default Re: Non-admin users unable to edit existing accounts, opportunities, contacts, etc

    The problem seems to be related to the last if-statement in the check_team_access function of teams_logic.php

    // Prevent empty editview if user go directly to edit
    if (is_null($bean->id) && $_REQUEST['action'] == 'EditView')
    header ("Location: index.php?module=".$_REQUEST['module']."&action=DetailView&record=".
    $_REQUEST['record']);


    When I comment that section out, the users are once again able to edit their records. So it looks like $bean->id is null, but what would be causing that?

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

    Default Re: Non-admin users unable to edit existing accounts, opportunities, contacts, etc

    Have a look at the code immediatly above what you have commented out!
    By commenting it out you are defeating the object of the module - to restrict access!

    $bean->id will ONLY be null of the code above set it to null and that would only happen if the user is NOT allowed to see the record!

    You have another problem somewhere - the module is supposed to restrict the access - that is what it does!
    --


    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

  8. #8
    badmin is offline Junior Member
    Join Date
    Feb 2009
    Posts
    4

    Default Re: Non-admin users unable to edit existing accounts, opportunities, contacts, etc

    Yes, I realized that. After making the changes I did test them out. The module was still restricting the records returned during searches. The only time someone would be able to access a record that isn't assigned to their team was if they accessed the url directly, but they were still prevented from editing it. If they tried to edit it, the result was that a new entry was created with a new ID in the system and assigned to the user and team that tried to edit the original record.

    So basically, the only change in functionality was that a user from another team could copy the record by trying to edit it... but that could be done manually anyway, since the code that I commented out was just redirecting to the DetailView where all the information already existed. An offending user could simply take the data from the DetailView and create a new entry using that data.

    The reason I took that step is that I in all cases, the $bean->id shouldn't have been null. The users were correctly added and assigned to the correct teams, and the accounts, contacts, etc, were also assigned to the same teams and users. I checked this countless times in the database tables themselves.

    Still, I realize my solution is not ideal, but still met our needs until a better solution is found. The functionality that WAS retained was doing what we needed anyway.

    In any case, I appreciate all of your previous help, and if I find out what the root cause of the problem is, I'll be sure to post again.

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: 2010-08-18, 07:21 AM
  2. Allow non-admin users to edit dropdowns
    By scheinarts in forum General Discussion
    Replies: 4
    Last Post: 2008-07-10, 06:39 PM
  3. Unable to effectively edit Contacts module
    By aimsmith in forum Help
    Replies: 1
    Last Post: 2006-12-14, 03:30 AM
  4. Users-Unable to add contacts
    By njoy in forum Help
    Replies: 2
    Last Post: 2006-09-01, 07:59 PM
  5. linking Accounts to Users from Accounts Edit Module
    By ghight in forum Developer Help
    Replies: 0
    Last Post: 2006-03-24, 10:15 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
  •