Hiding Records of Custom Entity

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • awltrs
    Junior Member
    • Apr 2025
    • 1

    Hiding Records of Custom Entity

    Hello all,

    I am rather new to EspoCRM, and I am trying to make some customizations.

    I have been tasked to create a custom entity for notes, which I have included in the Activity Entity List so that they work similar to meetings or calls and are related to a contact, account, etc. Users of the CRM system should be able to mark notes as private. To do so, I have added a Boolean field called "private" via the Entity Manager. If a note is marked as private (so Boolean field set to True) only the assigned user should be able to see the note. Any other user should not be able to see the note. I want to hide the entire record. It should not appear in any list, overview, etc.

    How can I implement such a functionality?

    I would appreciate any help or suggestions.

    Cheers,
    Anna
  • yuri
    Member
    • Mar 2014
    • 8845

    #2
    Hi Anna,

    It can be done.

    There are two separate logics that are responsible for access control.

    1. AccessChecker – responsible for checking access when we open a record.
    2. AccessControlFilter – responsible for adding filters to a select query (when a list of records is displayed).


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

    Define your custom access checker in metadata. Your access checker should implement Espo\Core\Acl\AccessEntityCREDChecker or Espo\Core\Acl\AccessEntityCREDSChecker. See Espo codebase for examples. You will need to add your implementation in methods that checks access to an entity.

    You need to define a 'mandatory' access filter. 'mandatory' is the reserved filter name that is applied for all users (even admin).

    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

    Working...