share(function (PhraseaApplication $app) { return new DatafileController($app, $app['phraseanet.appbox'], $app['acl'], $app['authentication']); }); } public function boot(Application $app) { } public function connect(Application $app) { $controllers = $app['controllers_factory']; $controllers->before(function (Request $request) use ($app) { if (!$app['authentication']->isAuthenticated()) { $app->abort(403, sprintf('You are not authorized to access %s', $request->getRequestUri())); } }); $controllers->get('/{sbas_id}/{record_id}/{subdef}/', 'controller.datafiles:getAction') ->bind('datafile') ->assert('sbas_id', '\d+') ->assert('record_id', '\d+'); return $controllers; } }