Thursday, November 25, 2010

some ACL problem

i have install acos,aros,aros-_acos table and add some code from
http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
step by step,by i have error:
Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in
permissions check. Node references:
Aro: Array
(
[User] => Array
(
[id] => 1
[username] => test
[group_id] => 1
[created] => 2010-11-25 09:06:17
[modified] => 2010-11-25 09:06:17
)

)

Aco: /Products/index [CORE\cake\libs\controller\components\acl.php,
line 273]
Code | Context


if (empty($aroPath) || empty($acoPath)) {
trigger_error(__("DbAcl::check() - Failed ARO/ACO node
lookup in permissions check. Node references:\nAro: ", true) .
print_r($aro, true) . "\nAco: " . print_r($aco, true),
E_USER_WARNING);

$aro = array(
"User" => array(
"id" => "1",
"username" => "test",
"group_id" => "1",
"created" => "2010-11-25 09:06:17",
"modified" => "2010-11-25 09:06:17"
)
)
$aco = "/Products/index"
$action = "*"
$permKeys = array(
"_create",
"_read",
"_update",
"_delete"
)
$aroPath = array(
array(
"Aro" => array()
)
)
$acoPath = false

DbAcl::check() - CORE\cake\libs\controller\components\acl.php, line
273
AclComponent::check() - CORE\cake\libs\controller\components\acl.php,
line 92
AuthComponent::isAuthorized() - CORE\cake\libs\controller\components
\auth.php, line 527
AuthComponent::startup() - CORE\cake\libs\controller\components
\auth.php, line 445
Component::triggerCallback() - CORE\cake\libs\controller
\component.php, line 186
Controller::startupProcess() - CORE\cake\libs\controller
\controller.php, line 527
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 187
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 83

Warning (2): Cannot modify header information - headers already sent
by (output started at D:\xampp\htdocs\ceramtest\www\cake\libs
\debugger.php:673) [CORE\cake\libs\controller\controller.php, line
746]
Code | Context

$status = "Location: http://localhost/ceramtest/www/"

header - [internal], line ??
Controller::header() - CORE\cake\libs\controller\controller.php, line
746
Controller::redirect() - CORE\cake\libs\controller\controller.php,
line 725
AuthComponent::startup() - CORE\cake\libs\controller\components
\auth.php, line 450
Component::triggerCallback() - CORE\cake\libs\controller
\component.php, line 186
Controller::startupProcess() - CORE\cake\libs\controller
\controller.php, line 527
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 187
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 83


i am test with admin user,but i have error,and i cant underetand how
can i create permissions for
groups

can i read all permissions from database or i must create all
permissions link this
function initDB() {
$group =& $this->User->Group;
//Allow admins to everything
$group->id = 1;
$this->Acl->allow($group, 'controllers');

//allow managers to posts and widgets
$group->id = 2;
$this->Acl->deny($group, 'controllers');
$this->Acl->allow($group, 'controllers/Posts');
$this->Acl->allow($group, 'controllers/Widgets');

//allow users to only add and edit on posts and widgets
$group->id = 3;
$this->Acl->deny($group, 'controllers');
$this->Acl->allow($group, 'controllers/Posts/add');
$this->Acl->allow($group, 'controllers/Posts/edit');
$this->Acl->allow($group, 'controllers/Widgets/add');
$this->Acl->allow($group, 'controllers/Widgets/edit');
//we add an exit to avoid an ugly "missing views" error message
echo "all done";
exit;
}

where is my problem?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: