{"action":"created","issue":{"url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/335","labels_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/335/labels{/name}","comments_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/335/comments","events_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/335/events","html_url":"https://github.com/sensiolabs/SensioFrameworkExtraBundle/issues/335","id":50035617,"number":335,"title":"[@Security] allow class-scope ACL in is_granted Annotation","user":{"login":"RubenKruiswijk","id":545128,"avatar_url":"https://avatars.githubusercontent.com/u/545128?v=3","gravatar_id":"","url":"https://api.github.com/users/RubenKruiswijk","html_url":"https://github.com/RubenKruiswijk","followers_url":"https://api.github.com/users/RubenKruiswijk/followers","following_url":"https://api.github.com/users/RubenKruiswijk/following{/other_user}","gists_url":"https://api.github.com/users/RubenKruiswijk/gists{/gist_id}","starred_url":"https://api.github.com/users/RubenKruiswijk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RubenKruiswijk/subscriptions","organizations_url":"https://api.github.com/users/RubenKruiswijk/orgs","repos_url":"https://api.github.com/users/RubenKruiswijk/repos","events_url":"https://api.github.com/users/RubenKruiswijk/events{/privacy}","received_events_url":"https://api.github.com/users/RubenKruiswijk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-11-25T14:50:24Z","updated_at":"2015-10-19T12:52:22Z","closed_at":null,"body":"When using class-scope aces in Symfony2 ACL, it would be useful to be able to use them in annotations. \r\n\r\nWhen listing Post objects for example, you might want to check if a user has LIST permissions on the Post class as an instantiated object is not available. In an action you could do that like this:\r\n\r\n```php\r\n$securityContext = $this->get('security.context');\r\n$securityContext->isGranted('LIST', new ObjectIdentity('class', '\\\\Entity\\\\Post')));\r\n```\r\n\r\nHow do I do that using Annotation, if even possible?\r\nUsing ``@Security`` annotation, it could look like this:\r\n```php\r\n/**\r\n  * @Security(\"is_granted('LIST', '\\\\Entity\\\\Post')\")\r\n  * @return Response\r\n  */\r\npublic function allPostsAction()\r\n{\r\n```"},"comment":{"url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/comments/149204724","html_url":"https://github.com/sensiolabs/SensioFrameworkExtraBundle/issues/335#issuecomment-149204724","issue_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/335","id":149204724,"user":{"login":"JHGitty","id":5406438,"avatar_url":"https://avatars.githubusercontent.com/u/5406438?v=3","gravatar_id":"","url":"https://api.github.com/users/JHGitty","html_url":"https://github.com/JHGitty","followers_url":"https://api.github.com/users/JHGitty/followers","following_url":"https://api.github.com/users/JHGitty/following{/other_user}","gists_url":"https://api.github.com/users/JHGitty/gists{/gist_id}","starred_url":"https://api.github.com/users/JHGitty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JHGitty/subscriptions","organizations_url":"https://api.github.com/users/JHGitty/orgs","repos_url":"https://api.github.com/users/JHGitty/repos","events_url":"https://api.github.com/users/JHGitty/events{/privacy}","received_events_url":"https://api.github.com/users/JHGitty/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T12:52:22Z","updated_at":"2015-10-19T12:52:22Z","body":"Agree to @iltar - I really need this! :+1: "}}