Visibility Framework and elasticsearch

Hi guys,

We are looking for some help / share of knowledge about the Visibility Framework, and more particularly the definition of the elasticsearch filter.

We coded a visibility query using the following article : https://support.sugarcrm.com/documentation/sugar_developer/sugar_developer_guide_14.0/architecture/teams/custom_record_visibility/#Visibility_Class.

Our business case is to restrict the visibility of cases to only assigned cases (easy part) ; then, according to those cases, the user can only see the records linked to those case. For instance, only the accounts that are linked to a case they are assigned to. Or only the tasks, meetings, calls etc. linked to the case they are assigned to.

The SQL filter definition to restrict the record visibilty in Sugar is OK.

But now we are more struggling about the way to define the same filter for elasticsearch ; for example, how to code the filter : display only the tasks that are linked to an open case that is assigned to the current user.

Any help / tips / tricks / code is welcome.

Best regards,

Fred

  • Are you saying the Elasticsearch strategy described in that link cannot be used in your case?

    That page states:

    "The visibility class should also implement Sugarcrm\Sugarcrm\Elasticsearch\Provider\Visibility\StrategyInterface so that the visibility rules are also applied to the global search. "

    I hope I am wrong but I think the only thing controlling your access in an API call is your Roles and Teams, so can your users still access all Accounts, etc via API?

    Francesca