{"issue":{"created_at":"2011-11-23T12:31:18Z","state":"open","updated_at":"2011-11-23T12:51:24Z","comments":1,"user":{"gravatar_id":"47a8fe9ed227e9c56cd5dba93c2c9118","id":626664,"url":"https://api.github.com/users/jonathaningram","login":"jonathaningram","avatar_url":"https://secure.gravatar.com/avatar/47a8fe9ed227e9c56cd5dba93c2c9118?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"A follow on from #22, but I've made a new issue since I noticed that you created a test for issue22.\r\n\r\nThe stack trace partial:\r\n\r\n```\r\n[RuntimeException]                                                                                              \r\n  There is no parameter with name \"project\" for method \"Jbi\\CoreBundle\\Manager\\ProjectsManager::createProject\".  \r\n\r\nException trace:\r\n () at /app/cache/dev/jms_security/expressions/8dfa724b356323205a4fc1f3616817cf5e7baa64.php:21\r\n```\r\n\r\nHere is a copy of the generated expression code:\r\n\r\n```php\r\n\r\n<?php\r\n// Expression: hasPermission(#project.getCompany(), 'OPERATOR') or hasRole('ROLE_SUPERUSER')\r\nreturn function(array $context) {\r\n    if (!isset($context['token'])) {\r\n        throw new RuntimeException('The context contains no item with key \"token\".');\r\n    }\r\n\r\n    if (!$context['token'] instanceof Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface) {\r\n        throw new RuntimeException(sprintf('The item \"token\" is expected to be of type \"Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface\", but got \"%s\".', get_class($context['token'])));\r\n    }\r\n\r\n    if (!isset($context['object'])) {\r\n        throw new RuntimeException('The context contains no item with key \"object\".');\r\n    }\r\n\r\n    if (!$context['object'] instanceof CG\\Proxy\\MethodInvocation) {\r\n        throw new RuntimeException(sprintf('The item \"object\" is expected to be of type \"CG\\Proxy\\MethodInvocation\", but got \"%s\".', get_class($context['object'])));\r\n    }\r\n\r\n    if (!isset($a['project'])) {\r\n        throw new RuntimeException(sprintf('There is no parameter with name \"project\" for method \"%s\".', $context['object']));\r\n    }\r\n\r\n    if (!$context['token'] instanceof Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface) {\r\n        throw new RuntimeException(sprintf('The item \"token\" is expected to be of type \"Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface\", but got \"%s\".', get_class($context['token'])));\r\n    }\r\n\r\n    $a = $context['token']->getRoles();\r\n    if (isset($context['role_hierarchy'])) {\r\n        $a = $context['role_hierarchy']->getReachableRoles($a);\r\n    }\r\n\r\n    $b = array();\r\n    foreach ($a as $role) {\r\n        $b[$role->getRole()] = true;\r\n    }\r\n    $a = $b;\r\n\r\n    return ($context['container']->get('security.acl.permission_evaluator')->hasPermission($context['token'], $context['object']->arguments[$a['project']]->getCompany(), 'OPERATOR')) || (isset($a['ROLE_SUPERUSER']));\r\n};\r\n```\r\n\r\nAs you can see, there is no variable `$a` at the right place, and even the `$a` that is declared contains roles, not the parameter.","assignee":null,"labels":[],"id":2329174,"number":23,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"There is no parameter with name \"project\" for method \"Jbi\\CoreBundle\\Manager\\ProjectsManager::createProject\".","closed_at":null,"html_url":"https://github.com/schmittjoh/JMSSecurityExtraBundle/issues/23","milestone":null,"url":"https://api.github.com/repos/schmittjoh/JMSSecurityExtraBundle/issues/23"},"action":"created","comment":{"created_at":"2011-11-23T12:51:24Z","updated_at":"2011-11-23T12:51:24Z","user":{"gravatar_id":"96a13b96ece78afe3c2dc841edc4a8f5","id":197017,"url":"https://api.github.com/users/schmittjoh","login":"schmittjoh","avatar_url":"https://secure.gravatar.com/avatar/96a13b96ece78afe3c2dc841edc4a8f5?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"That doesn't look correct, will take a look later.","id":2848306,"url":"https://api.github.com/repos/schmittjoh/JMSSecurityExtraBundle/issues/comments/2848306"}}