mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Bugfixes/tasks list
This commit is contained in:
@@ -33,12 +33,14 @@ class ParentRoleHelper
|
||||
* Return all the role which give access to the given role. Only the role
|
||||
* which are registered into Chill are taken into account.
|
||||
*
|
||||
* The array contains always the current $role (which give access to himself)
|
||||
*
|
||||
* @param string $role
|
||||
* @return string[] the role which give access to the given $role
|
||||
*/
|
||||
public function getParentRoles(string $role): array
|
||||
{
|
||||
$parentRoles = [];
|
||||
$parentRoles = [$role];
|
||||
// transform the roles from role hierarchy from string to Role
|
||||
$roles = \array_keys($this->hierarchy);
|
||||
|
||||
|
@@ -14,7 +14,7 @@ class FilterOrderHelper
|
||||
private ?array $searchBoxFields = null;
|
||||
private array $checkboxes = [];
|
||||
private ?array $submitted = null;
|
||||
private ?string $formName = 'filter';
|
||||
private ?string $formName = 'f';
|
||||
private string $formType = FilterOrderType::class;
|
||||
private array $formOptions = [];
|
||||
|
||||
|
@@ -23,9 +23,10 @@ class ParentRoleHelperTest extends KernelTestCase
|
||||
|
||||
$parentRoles = $this->parentRoleHelper->getParentRoles(PersonVoter::SEE);
|
||||
|
||||
$this->assertCount(2, $parentRoles);
|
||||
$this->assertCount(3, $parentRoles);
|
||||
$this->assertContains(PersonVoter::CREATE, $parentRoles);
|
||||
$this->assertContains(PersonVoter::UPDATE, $parentRoles);
|
||||
$this->assertContains(PersonVoter::SEE, $parentRoles);
|
||||
}
|
||||
|
||||
public function testIsRoleReached()
|
||||
|
Reference in New Issue
Block a user