내가 뭔가 잘못하고 있습니다. 모듈에 대한 액세스를 제한하고 싶습니다. 로그인 한 사용자 만 tijdmachine 모듈에 액세스 할 수 있습니다. ZF2, module.config의 ByjAuthorize 규칙
<?php
namespace Tijdmachine;
return array(
'resource_providers' => array(
'BjyAuthorizeProviderResourceConfig' => array(
'tijdmachine' => array(),
),
),
'rule_providers' => array(
'BjyAuthorizeProviderRuleConfig' => array(
'allow' => array(
array(array('user'), 'tijdmachine', array('index')),
),
),
),
'view_manager' => array(
'template_path_stack' => array(__DIR__ . '/../view')
),
'controllers' => array(
'invokables' => array(
'Tijdmachine\Controller\IndexController' => 'Tijdmachine\Controller\IndexController',
)
),
'router' => array(
'routes' => array(
'tijdmachine' => array(
'resource' => 'tijdmachine',
'privilege' => 'index',
'type' => 'segment',
'options' => array(
'route' => '/tijdmachine',
// <---- url format module/action/id
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Tijdmachine\Controller\IndexController',
// <--- Defined as the module controller
'action' => 'index',
// <---- Default action
),
),
),
),
),
);
내가 자원, 권한을 정의 내 경로에서 그들을 이름 :
이 내 module.config.php입니다. 그러나 특정 URL로 이동하면 로그인하지 않고도 모든 정보를 볼 수 있습니다. 내가 뭘 잘못하고 있니?
미리 감사드립니다.
'자원'과 '특권'을 [탐색 용기 (HTTPS의 매개 변수입니다. org/ko/latest/modules/zend.navigation.pages.html # common-page-features)을 참조하십시오. – AlexP