cakephp - Create aro/aco having an aro and an aco -
i'm trying implement pdf functionality application. so, added new actions in controllers (like 'viewpdf'). after this, rebuild acl tree build_acl action (from mark story tutorial automated tool creating acos ). so, can see mysql new node created. until this, fine. try test viewpdf button, , 'you not authorized access location.' error (even being admin). check error.log file , see warning:
> aco: controllers/specializations/viewpdf in [/usr/share/php/cake/libs/controller/components/acl.php, line 273] 2011-02-24 11:40:34 warning: warning (512): dbacl::check() - failed aro/aco node lookup in permissions check. node references: aro: array ( [user] => array ( [id] => 1 [email] => admin@gmail.com [group_id] => 1 ) ) aco: controllers/specializations/viewpdf in [/usr/share/php/cake/libs/controller/components/acl.php, line 273]
then check aros_acos table in database , see there's no 'viewpdf' aco related node, there's aro, aco, not aro_aco, suppose reason why i'm getting error.
¿are suppositions right? if are, how create aro_aco? i'm afraid break if manually...
thanks in advance,
alf.
alfizqu,
if have aro , aco no connection between these means of entries in aco_aro table, means have not set permissions aros have on acos.
proceed this:
/* * copied tutorial, , modified, function initializes per- * missions accessing controller actions. */ function initdb() { $group =& $this->user->group; // d m n s $group->id = 3; $this->acl->allow($group, 'controllers'); // m n g e r s $group->id = 2; $this->acl->deny($group, 'controllers'); $this->acl->allow($group, 'controllers/items','*'); ... ...
once have set such initdb function, have run once calling browser. if not suffice on track, go on basic auth/acl tutorial again. yours, benjamin.
edit 1: 1 of crucial points call parent::beforefilter()
in beforefilter()
methods of self-defined controllers , setting app_controller
. if these tips not help, time-efficient way go on acl/auth tutorial very carefully, starting fresh cake environment. once can , running there, confident in app.
edit 2: , don't afraid throw out acl/auth related of app. sounds daunting, can safe lot of debugging headaches/time.
p.s.: btw there should moderately usable acl/auth plugins @ bakery , 1 @ sourceforge.
Comments
Post a Comment