cakephp 3.0 Acl控制器为空

时间:2015-09-10 11:18:21

标签: cakephp acl

我试图调用AclComponent函数并检查给定的控制器是否具有权限 使用DB记录它应该具有权限但检查函数返回false

use Cake\ORM\TableRegistry;
use Cake\Controller\ComponentRegistry;
use Acl\Controller\Component\AclComponent;
use Cake\Core\Configure;
$registry = new ComponentRegistry();
$acl = new AclComponent($registry);
debug($acl->check(array('model' => 'User', 'foreign_key' => $_SESSION['Auth']['User']['id']), 'Houses/index'));die();

注册表数组:

object(Cake\Controller\ComponentRegistry) {

    '_Controller' => null,
    '_loaded' => [],
    '_eventManager' => null,
    '_eventClass' => '\Cake\Event\Event'

}

0 个答案:

没有答案