add test for complete activity crud (without errors)

+ fix some errors in controller (discovered with tests)
This commit is contained in:
2015-10-08 18:24:25 +02:00
parent fa5da95bf1
commit e79ca23f2c
3 changed files with 92 additions and 27 deletions

View File

@@ -44,6 +44,12 @@ class ActivityController extends Controller
$em = $this->getDoctrine()->getManager();
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
if ($person === NULL) {
throw $this->createNotFoundException('Person not found');
}
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
$reachableScopes = $this->get('chill.main.security.authorization.helper')
->getReachableScopes($this->getUser(), new Role('CHILL_ACTIVITY_SEE'),
$person->getCenter());