Collaborator in ACL/Roles

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • item
    replied
    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);  
        }  

    Leave a comment:


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

    Leave a comment:


  • item
    started a topic Collaborator in ACL/Roles

    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






Working...