added configurable permission system (#424)

This commit is contained in:
Kevin Papst
2018-11-26 13:20:32 +01:00
committed by GitHub
parent 0334f6ce86
commit 8fddf627bf
62 changed files with 1831 additions and 794 deletions

View File

@@ -34,6 +34,16 @@ trait KernelTestTrait
$executor->execute($loader->getFixtures(), true);
}
/**
* @param EntityManager $em
* @param string $username
* @return User|null
*/
protected function getUserByName(EntityManager $em, string $username)
{
return $em->getRepository(User::class)->findOneBy(['username' => $username]);
}
/**
* @param EntityManager $em
* @param string $role
@@ -64,6 +74,6 @@ trait KernelTestTrait
return null;
}
return $em->getRepository(User::class)->findOneBy(['username' => $name]);
return $this->getUserByName($em, $name);
}
}