Make record based on status accessible only to users with role

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Maarten
    Member
    • Jun 2020
    • 56

    Make record based on status accessible only to users with role

    Hi,

    I would like to make records based on status accessible to users with specific roles.

    So e.g. record Volunteer, with status Applicant, Active, Excited.
    I want regular users to only be able to access active volunteers. And someone with a specific role to see also Applicant and Excited volunteers.

    I wasn't able yet to find the conditional logic to do this.

    Any thoughts?
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Hi Maarten,

    It will require some coding. You need a custom ACL checker and SELECT filter.

    1. ACL

    Access checker https://docs.espocrm.com/development...eckerclassname

    It checks access to a specific record.

    2. SELECT

    Access control filter: https://docs.espocrm.com/development...erclassnamemap

    Applies conditions to SQL when records are selected.

    You can define mandatory filter that will be always applied for all users. In this filter class apply where conditions depending on a user.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • yuri
      Member
      • Mar 2014
      • 8440

      #3
      Custom access checker example: https://github.com/espocrm/espocrm/b...essChecker.php

      Custom access filter example: https://github.com/espocrm/espocrm/b.../Mandatory.php
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment


      • a.slyzhko
        a.slyzhko commented
        Editing a comment
        I'm trying to extend access to records. And get success with single record with AccessChecker, but no luck with list view. I applied Mandatory filter to select records, but they don't appear on front-end
    Working...