我必须在现有的Symfony2应用程序中为ACL实现sylius / rbac-bundle。 我已经看到我认为关于这个主题可以搜索出来的一切,但无处可见。
我该怎么做? 我有用户实体。现在使用这个新捆绑包我该怎么办?
我安装了sylius / rbac-bundle以及所有必需的依赖项。
"sylius/resource": "0.14.*@dev",
"sylius/translation": "0.14.*@dev",
"sylius/translation-bundle": "0.14.*@dev",
"sylius/storage": "0.14.*@dev",
"sylius/resource-bundle": "0.14.*@dev",
"sylius/rbac": "0.14.*@dev",
"sylius/rbac-bundle": "0.14.*@dev"
并将其添加到AppKernel:
new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
new Sylius\Bundle\TranslationBundle\SyliusTranslationBundle(),
new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
new Sylius\Bundle\RbacBundle\SyliusRbacBundle(),
我看到有一个控制台命令:
sylius:rbac:initialize
但现在php app/console
导致以下错误:
[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
The service "sylius.translatable.listener" has a dependency on a non-existent parameter "sylius.translation.mapping".
Did you mean one of these: "sylius.translation.default.mapping", "sylius_translation.driver"?
关于可能出错的任何想法?
答案 0 :(得分:1)
您还需要配置Sylius TranslationBundle
sylius_translation:
default_mapping:
translatable:
field: translations
currentLocale: currentLocale
fallbackLocale: fallbackLocale
translation:
field: translatable
locale: locale