mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Do not block transition in EntityWorkflow when the user is member of a dest user group
- refactor EntityWorkflowGuardTransition + tests - allow to find easily user within userGroup by adding a dedicated method to UserGroup::contains
This commit is contained in:
@@ -141,4 +141,9 @@ class UserGroup
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function contains(User $user): bool
|
||||
{
|
||||
return $this->users->contains($user);
|
||||
}
|
||||
}
|
||||
|
@@ -203,7 +203,9 @@ class EntityWorkflowStep
|
||||
|
||||
/**
|
||||
* get all the users which are allowed to apply a transition: those added manually, and
|
||||
* those added automatically bu using an access key.
|
||||
* those added automatically by using an access key.
|
||||
*
|
||||
* This method exclude the users associated with user groups
|
||||
*
|
||||
* @psalm-suppress DuplicateArrayKey
|
||||
*/
|
||||
@@ -217,6 +219,14 @@ class EntityWorkflowStep
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, UserGroup>
|
||||
*/
|
||||
public function getDestUserGroups(): Collection
|
||||
{
|
||||
return $this->destUserGroups;
|
||||
}
|
||||
|
||||
public function getCcUser(): Collection
|
||||
{
|
||||
return $this->ccUser;
|
||||
|
Reference in New Issue
Block a user