繁体   English   中英

Symfony2:“ jms_security_extra”下的无法识别的选项“ method_access_control”错误

[英]Symfony2: Unrecognized options “method_access_control” under “jms_security_extra” error

因此,我尝试通过JMSSecurityExtraBundle在此处为某些方法配置安全性访问。 我只是按照这里的说明进行操作: JMSSecurityBundle Doc

我最终在我的config.yml文件中有了这个:

jms_security_extra:
    secure_controllers:  true
    secure_all_services: false
    method_access_control:
        'MyBundle:.*:postEntityDelete': 'hasRole("ROLE_SUPER_ADMIN")'

现在,我只是收到该错误:

InvalidConfigurationException: Unrecognized options "method_access_control" under "jms_security_extra"

这么少我怎么会出错? 陷阱在哪里,我该如何解决这个问题?

提前致谢!

编辑:

滴水:

[JMSSecurityExtraBundle]
    git=https://github.com/schmittjoh/JMSSecurityExtraBundle.git
    target=/bundles/JMS/SecurityExtraBundle

[metadata]
    git=https://github.com/schmittjoh/metadata.git
    version=1.1.0 ; <- make sure to get 1.1, not 1.0

[JMSAopBundle]
    git=https://github.com/schmittjoh/JMSAopBundle.git
    target=/bundles/JMS/AopBundle

[cg-library]
    git=https://github.com/schmittjoh/cg-library.git

[JMSDiExtraBundle]
    git=https://github.com/schmittjoh/JMSDiExtraBundle.git
    target=/bundles/JMS/DiExtraBundle

Deps.lock:

symfony v2.0.13
twig v1.7.0
monolog 1.0.2
doctrine-common 2.1.4
doctrine-dbal 2.1.6
doctrine 2.1.6
swiftmailer v4.1.7
assetic v1.0.3
twig-extensions 446d870272cd87a720e95242eade38a2acf56eaa
metadata 1.0.0
SensioFrameworkExtraBundle cb61b92ed55241d93ed9726bc3f5f47c7d2ce8fe
JMSSecurityExtraBundle e752f888c51425f71382c056961f10f2be642102
SensioDistributionBundle 20b66a408084ad8752f98e50f10533f5245310bf
SensioGeneratorBundle b1ccb78c1743f30817b0fce9bb5c6baff6ed7bf8
AsseticBundle v1.0.1

您正在使用什么版本的symfony和捆绑软件? 您链接的文档位于master分支之后。 左上角有更改版本的链接。 1.0似乎没有该配置选项。

deps文件应包含:

[JMSSecurityExtraBundle]
  git=http://github.com/schmittjoh/JMSSecurityExtraBundle.git
  target=/bundles/JMS/SecurityExtraBundle
  version=origin/master

您也可以在这里看到遇到相同问题的其他人https://github.com/schmittjoh/JMSSecurityExtraBundle/issues/24

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM