安全性“AccessDecisionManager.php第52行中的InvalidArgumentException”:不支持策略“肯定”

时间:2015-01-12 17:58:55

标签: php symfony frameworks

我已经在https://www.olympe.in/上传了我的第一个symfony项目。

所以,我有一个空白页。

当我使用 app_dev.php 时,我遇到了这个问题:

InvalidArgumentException in 
     

/dns/in/olympe/loicg/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php

     第52行:不支持“肯定”策略。

in AccessDecisionManager.php line 52
at AccessDecisionManager->__construct(array(object(RoleHierarchyVoter),
     

object(ExpressionVoter),object(AuthenticatedVoter)),'肯定',   false,true)在appDevDebugProjectContainer.php第3456行       在appDevDebugProjectContainer-> getSecurity_Access_DecisionManagerService()   在bootstrap.php.cache第2097行       at Container-> get('security.access.decision_manager')在appDevDebugProjectContainer.php第1933行       在appDevDebugProjectContainer-> getSecurity_AuthorizationCheckerService()   在bootstrap.php.cache第2097行       at Container-> get('security.authorization_checker')在appDevDebugProjectContainer.php第1946行       在appDevDebugProjectContainer-> bootSerap.php.cache第2097行中的getSecurity_ContextService()       at Container-> get('security.context','2')在appDevDebugProjectContainer.php第3103行       在bootDerap.php.cache第2097行中的appDevDebugProjectContainer-> getTwigService()       at Container-> get('twig')在appDevDebugProjectContainer.php第316行       在appDevDebugProjectContainer-> getAssetic_AssetManagerService()在bootstrap.php.cache第2097行       at Container-> get('assetic.asset_manager')在appDevDebugProjectContainer.php第1902行       在appDevDebugProjectContainer-> getStouting_LoaderService()在bootstrap.php.cache第2097行       在Router-php第54行的Container-> get('routing.loader')       在Router.xp第344行的Router-> getRouteCollection()中       在Router.xp第267行的Router-> getMatcherDumperInstance()中       在Router.>在Router.php第233行的getMatcher()中       在RouterListener.php第125行中的Router-> matchRequest(object(Request))       在RouterListener-> onKernelRequest(对象(GetResponseEvent),'kernel.request',对象(ContainerAwareEventDispatcher))       at call_user_func(array(object(RouterListener),'onKernelRequest'),object(GetResponseEvent),'kernel.request',   WrappedListener.php第59行中的object(ContainerAwareEventDispatcher))       at WrappedListener-> __ invoke(object(GetResponseEvent),'kernel.request',object(ContainerAwareEventDispatcher))       at call_user_func(object(WrappedListener),object(GetResponseEvent),'kernel.request',   eventDispatcher.php第164行中的object(ContainerAwareEventDispatcher)       在EventDispatcher-> doDispatch(array(对象(WrappedListener),对象(WrappedListener),对象(WrappedListener),   object(WrappedListener),object(WrappedListener),   object(WrappedListener),object(WrappedListener),   object(WrappedListener),object(WrappedListener),   object(WrappedListener)),'kernel.request',object(GetResponseEvent))   在EventDispatcher.php第53行中       在ContainerAwareEventDispatcher.php行的EventDispatcher-> dispatch('kernel.request',object(GetResponseEvent))   167       在TraceableEventDispatcher.php第112行的ContainerAwareEventDispatcher-> dispatch('kernel.request',object(GetResponseEvent))       在traceableEventDispatcher->在bootstrap.php.cache第3009行中的dispatch('kernel.request',object(GetResponseEvent))       在bootstrap.php.cache第2982行的HttpKernel-> handleRaw(object(Request),'1')       at HttpKernel-> handle(object(Request),'1',true)在bootstrap.php.cache第3131行       在ContainerAwareHttpKernel-> handle(object(Request),'1',true)在bootstrap.php.cache第2376行       在app_dev.php第21行的Kernel->句柄(对象(请求))

注意:我之前删除了缓存。

这是prod.log:

[2015-01-12 20:11:12] request.INFO: Matched route "home" (parameters: "_controller": "AppBundle\Controller\IndexController::indexAction", "_route": "home") [] []
[2015-01-12 20:11:12] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The strategy "affirmative" is not supported." at /dns/in/olympe/loicg/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php line 52 {"exception":"[object] (InvalidArgumentException(code: 0): The strategy \"affirmative\" is not supported. at /dns/in/olympe/loicg/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php:52)"} []
[2015-01-12 20:11:12] request.CRITICAL: Exception thrown when handling an exception (InvalidArgumentException: The strategy "affirmative" is not supported.) {"exception":"[object] (InvalidArgumentException(code: 0): The strategy \"affirmative\" is not supported. at /dns/in/olympe/loicg/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php:52)"} []

我启用了php错误报告,一切似乎都没问题。

security.yml:

#    security:
#        providers:
#            in_memory:
#                memory: ~

#        firewalls:
#            dev:
#                pattern: ^/(_(profiler|wdt|error)|css|images|js)/
#                security: false

#            default:
#                anonymous: ~

0 个答案:

没有答案