Custom Visibility Code

Hi Everyone,

Does anyone know if it's possible to have custom visibility code that will show a module results in the sub panels under a record but not allow the user to open that result or view the result in a report unless that have access to the team associated with the result? Hopefully the example below makes sense.

Example:

Organization #1:
Opportunity 1 - Blue Team
Opportunity 2 - Red Team

In the example above, I would want to open up organization #1 and see both opportunities below it. However if I am only on Red team then I should not be able to open up Opportunity 1 as it is assigned to Blue team or see it in a report.

Thanks in advance!

Parents
  • Hi Dan,

    I can't think of an out of the box solution for this, but you might be able to override the teams limitations on a per-view basis limiting non team members to read-only on list and subpanel views only.

    In your shoes, I would start with reviewing the acl code, and trying to reverse-engineer it:

    data/acl/SugarACLParentModule.php

    then seeing how 's post here:

    https://enricosimonetti.com/powerful-customisations-with-sugars-acl/

    can be adapted to your particular situation.

    There may be something in the context variable that will tell you what kind of view you are, in which case it should not be hard to customize it based on Enrico's code.

    I'll be interested to see if others come up with different ideas...

    Good luck!

    FrancescaS

  • Recently I've had to make some fields read only based on business rules, and the custom ACL way is definitely the way to go.  It's quite an elegant framework.

    Previously I've done it using client side code, but that doesn't apply to the mobile app or web client.

    Note that you need to call your custom ACL 'SugarACL<whatever>' for the auto loader to pick it up.

Reply
  • Recently I've had to make some fields read only based on business rules, and the custom ACL way is definitely the way to go.  It's quite an elegant framework.

    Previously I've done it using client side code, but that doesn't apply to the mobile app or web client.

    Note that you need to call your custom ACL 'SugarACL<whatever>' for the auto loader to pick it up.

Children
No Data