Collaborator in ACL/Roles

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • item
    Active Community Member
    • Mar 2017
    • 1557

    #1

    Collaborator in ACL/Roles

    Hi EspoCrm Teams,

    this is a feature request or maybe a entry in back log

    Actually, we have theses options :
    - all
    - team
    - own
    - no

    Add new option "collaborator"

    I have a process who create a entity and relate all "work" make by users.

    entity1
    -> work1 user1 team A
    -> work2 user2 team B

    so my goal is restrict access to entity1 only collaborator because many team.

    other exemple
    user1 is in team A and team B

    entity1
    -> work1 user2 team B
    in this sample, user1 must not have access to entity1

    You can say, why not use entity1->teams, because entity1 is with another team C who have full access. but, we will give "read access" to all collaborator related to entity.

    It's acceptable as feature ?

    Thanks






    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9639

    #2
    The decision not to add the collaborator role level was made after very long analysis. It took months. Unlikely to be revised.

    Comment

    • item
      Active Community Member
      • Mar 2017
      • 1557

      #3
      Thanks Yuri,
      as we work in ehealt.. this is a major "to have" for us... but as espoCrm is really perfect, it's simply the code below.

      easy to do in back-end and perfect for us.


      PHP Code:

      namespace Espo\Custom\Classes\Select\Box\AccessControlFilters;  
        
      use 
      Espo\Core\Select\AccessControl\Filter;  
      use 
      Espo\Core\Select\Helpers\RelationQueryHelper;  
      use 
      Espo\Entities\User;  
      use 
      Espo\ORM\Name\Attribute;  
      use 
      Espo\ORM\Query\SelectBuilder as QueryBuilder;  
        
      class 
      Mandatory implements Filter  
      {  
          public function 
      __construct(  
              private 
      User $user,  
              private 
      string $entityType,  
              private 
      RelationQueryHelper $relationQueryHelper,  
          ) {}  
        
          public function 
      apply(QueryBuilder $queryBuilder): void  
          
      {  
              
      $collaboratorsWhere $this->relationQueryHelper->prepareCollaboratorsWhere(  
                  
      $this->entityType,  
                  
      $this->user->getId()  
              );  
        
              
      $queryBuilder->where($collaboratorsWhere);  
          }  

      If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

      Comment

      Working...