我试图调用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'
}