schmittjoh/JMSSecurityExtraBundle — Issue #23: There is no parameter with name "project" for method "Jbi\CoreBundle\Manager\ProjectsManager::createProject".
Author: jonathaningram
Created: 2011-11-23 12:31:18+00:00
State: open

A follow on from #22, but I've made a new issue since I noticed that you created a test for issue22.

The stack trace partial:

```
[RuntimeException]
There is no parameter with name "project" for method "Jbi\CoreBundle\Manager\ProjectsManager::createProject".

Exception trace:
() at /app/cache/dev/jms_security/expressions/8dfa724b356323205a4fc1f3616817cf5e7baa64.php:21
```

Here is a copy of the generated expression code:

```php

getRoles();
if (isset($context['role_hierarchy'])) {
$a = $context['role_hierarchy']->getReachableRoles($a);
}

$b = array();
foreach ($a as $role) {
$b[$role->getRole()] = true;
}
$a = $b;

return ($context['container']->get('security.acl.permission_evaluator')->hasPermission($context['token'], $context['object']->arguments[$a['project']]->getCompany(), 'OPERATOR')) || (isset($a['ROLE_SUPERUSER']));
};
```

As you can see, there is no variable `$a` at the right place, and even the `$a` that is declared contains roles, not the parameter.