{"issue":{"created_at":"2011-12-10T18:49:59Z","state":"open","updated_at":"2011-12-10T19:36:00Z","comments":9,"user":{"gravatar_id":"34c17828d5b464aaa1b382b34e9ab1f8","id":387904,"url":"https://api.github.com/users/jalliot","avatar_url":"https://secure.gravatar.com/avatar/34c17828d5b464aaa1b382b34e9ab1f8?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jalliot"},"body":"Hi all,\r\n\r\nAt the moment, if someone wants to use both `FOSRestBundle` and `JMSSecurityExtraBundle` (master but I guess it would be the same with branch 2.0 which is packaged in Symfony SE), he would have an exception thrown if he tries to have a controller using JMSSecurityExtraBundle's annotations AND FOSRestBundle view handler mechanism.\r\n\r\nFor example, I have this (simplified) controller:\r\n\r\n``` php\r\n<?php\r\n\r\nnamespace Acme\\DemoBundle\\Controller;\r\n\r\nuse FOS\\RestBundle\\Controller\\Annotations\\View;\r\nuse JMS\\SecurityExtraBundle\\Annotation\\PreAuthorize;\r\n\r\nclass EventsController\r\n{\r\n    /**\r\n     * @View()\r\n     */\r\n    public function getEventsAction()\r\n    {\r\n        $events = ...\r\n\r\n        return $events;\r\n    }\r\n\r\n    /**\r\n     * @PreAuthorize(\"isAuthenticated()\")\r\n     * @View()\r\n     */\r\n    public function deleteEventAction($id)\r\n    {\r\n        ...\r\n\r\n        return RouteRedirectView::create('get_events');\r\n    }\r\n}\r\n```\r\n\r\nIf I try to access either of the actions, I get the following exception:\r\n\r\n```\r\n\\InvalidArgumentException('The \"Acme\\DemoBundle\\Controller\\EventsController__CG__0e4fce853343556568bf49535d279f54ad327102\" class does not look like a controller class (it must be in a \"Controller\" sub-namespace and the class name must end with \"Controller\")')\r\n```\r\n\r\nIf we don't use JMSSecurityExtraBundle's annotations, then it's all good but we lose much of the usefulness of this bundle.\r\n\r\nI'd understand that you might not want to support another bundle yourself but I'm mainly proposing because JMSSecurityExtraBundle is a very used bundle and most importantly is packaged within the SE.\r\n\r\n/cc @schmittjoh @lsmith77 ","assignee":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"id":2512192,"number":156,"labels":[],"title":"Consider supporting JMSSecurityExtraBundle","html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/issues/156","closed_at":null,"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/156","milestone":null},"action":"created","comment":{"created_at":"2011-12-10T19:36:00Z","updated_at":"2011-12-10T19:36:00Z","user":{"gravatar_id":"96a13b96ece78afe3c2dc841edc4a8f5","id":197017,"url":"https://api.github.com/users/schmittjoh","avatar_url":"https://secure.gravatar.com/avatar/96a13b96ece78afe3c2dc841edc4a8f5?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"schmittjoh"},"body":"Why? Just curious, have you used AOP yet?\n\nOn Sat, Dec 10, 2011 at 8:30 PM, Christophe Coevoet <\nreply@reply.github.com\n> wrote:\n\n> @schmittjoh using AOP seems overkill here. the listener simply reads an\n> annotation on the controller and sets a request attribute when it exists\n>\n> ---\n> Reply to this email directly or view it on GitHub:\n>\n> https://github.com/FriendsOfSymfony/FOSRestBundle/issues/156#issuecomment-3092509\n>","id":3092537,"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/comments/3092537"}}