diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php index cd3126b72..1419aa47a 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php @@ -289,8 +289,8 @@ class LoadPeople extends AbstractFixture implements OrderedFixtureInterface, Con 'center' => 'centerA', 'maritalStatus' => 'ms_divorce' ), - array( - //to have a person with same firstname as Gérard Depardieu + array( + //to have a person with same firstname as Gérard Depardieu 'LastName' => "Depardieu", 'FirstName' => "Jean", 'Birthdate' => "1960-10-12", @@ -299,28 +299,48 @@ class LoadPeople extends AbstractFixture implements OrderedFixtureInterface, Con 'center' => 'centerA', 'maritalStatus' => 'ms_divorce' ), - array( - //to have a person with same birthdate of Gérard Depardieu - 'LastName' => 'Van Snick', - 'FirstName' => 'Bart', - 'Birthdate' => '1948-12-27', - 'center' => 'centerA', - 'maritalStatus' => 'ms_legalco' - ), - array( - //to have a woman with Depardieu as FirstName - 'LastName' => 'Depardieu', - 'FirstName' => 'Charline', - 'Gender' => Person::FEMALE_GENDER, - 'center' => 'centerA', - 'maritalStatus' => 'ms_legalco' - ), - array( - //to have a special character in lastName - 'LastName' => 'Manço', - 'FirstName' => 'Étienne', - 'center' => 'centerA', - 'maritalStatus' => 'ms_unknown' - ) + array( + //to have a person with same birthdate of Gérard Depardieu + 'LastName' => 'Van Snick', + 'FirstName' => 'Bart', + 'Birthdate' => '1948-12-27', + 'center' => 'centerA', + 'maritalStatus' => 'ms_legalco' + ), + array( + //to have a woman with Depardieu as FirstName + 'LastName' => 'Depardieu', + 'FirstName' => 'Charline', + 'Gender' => Person::FEMALE_GENDER, + 'center' => 'centerA', + 'maritalStatus' => 'ms_legalco' + ), + array( + //to have a special character in lastName + 'LastName' => 'Manço', + 'FirstName' => 'Étienne', + 'center' => 'centerA', + 'maritalStatus' => 'ms_unknown' + ), + array( + //to have true duplicate person + 'LastName' => "Depardieu", + 'FirstName' => "Jean", + 'Birthdate' => "1960-10-12", + 'CountryOfBirth' => 'FR', + 'Nationality' => 'FR', + 'center' => 'centerA', + 'maritalStatus' => 'ms_divorce' + ), + array( + //to have false duplicate person + 'LastName' => "Depardieu", + 'FirstName' => "Jeanne", + 'Birthdate' => "1966-11-13", + 'CountryOfBirth' => 'FR', + 'Nationality' => 'FR', + 'center' => 'centerA', + 'maritalStatus' => 'ms_legalco' + ), ); } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php index 0e3cb6dc9..a3f42ced9 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php @@ -50,24 +50,36 @@ class LoadPersonACL extends AbstractFixture implements OrderedFixtureInterface case 'social': case 'direction': printf("Adding CHILL_PERSON_UPDATE & CHILL_PERSON_CREATE to %s permission group \n", $permissionsGroup->getName()); + $roleScopeUpdate = (new RoleScope()) ->setRole('CHILL_PERSON_UPDATE') ->setScope(null); $permissionsGroup->addRoleScope($roleScopeUpdate); + $roleScopeCreate = (new RoleScope()) ->setRole('CHILL_PERSON_CREATE') ->setScope(null); $permissionsGroup->addRoleScope($roleScopeCreate); + + $roleScopeDuplicate = (new RoleScope()) + ->setRole('CHILL_PERSON_DUPLICATE') + ->setScope(null); + $permissionsGroup->addRoleScope($roleScopeDuplicate); + $roleScopeList = (new RoleScope()) ->setRole(PersonVoter::LISTS) ->setScope(null); $permissionsGroup->addRoleScope($roleScopeList); + $roleScopeStats = (new RoleScope()) ->setRole(PersonVoter::STATS) ->setScope(null); $permissionsGroup->addRoleScope($roleScopeStats); + $manager->persist($roleScopeUpdate); $manager->persist($roleScopeCreate); + $manager->persist($roleScopeDuplicate); + break; case 'administrative': printf("Adding CHILL_PERSON_SEE to %s permission group \n", $permissionsGroup->getName());