0

在 CakePHP 中,我有这样的配置:

//Config/routes.php
Router::connect('/viewServices', array('plugin' => 'usermgmt', 'controller' => 'services', 'action' => 'viewServices'));

//View/Users/dashboard.ctp
<?php echo $this->Html->link(__("Services",true),"/viewServices")?>

//View/Services/view_services.ctp
//I put here the view..

//Controller/ServicesController.php
public function viewServices(){
....
}

现在我无法理解它不起作用的原因!

我看不到“view_services.ctp”。服务器将我重定向到“access_denied.ctp”页面,但在“view_services.ctp”中我没有对身份验证进行任何控制,所以也许我正在做其他错误。有人可以帮助我吗?

谢谢!

4

1 回答 1

0

我解决了改变它的问题:

//Controller/Component/UserAuthComponent.php
.....
//CHANGE IT:
//if(!$userGroupModel->isUserGroupAccess($controller, $action, $this->getGroupId()))
//WITH IT:
if(!$userGroupModel->isUserGroupAccess($controller, $action, 1))

这样,它就起作用了!

谢谢大家!

于 2014-07-04T11:30:30.927 回答