Search code examples
cakephpaclcakephp-2.3

CakePHP: repopulating wrongly cleaned acos table


While clearing out some old tables and data, we mistakenly cleaned up the acos table as well, without realizing it was tied to ACLs.

This is the error that now comes up whenever a user tries to update their profile:

AclNode::node() - Couldn't find Aco node identified by 
"Array ( [Aco0.model] => User [Aco0.foreign_key] => xxx ) "

Attached is what the "acos" table looks like once wiped and re-populated - user_id entries between 7 and 63 were deleted.

enter image description here

Is there any way to repopulate the missing entries in this existing "acos" table?


Solution

  • You can re-sync your ACO's with the AclExtras plugin. Download and install it (see the docs for instructions) and then run the aco_sync shell action:

    cd /path/to/your/app
    Console/cake AclExtras.AclExtras aco_sync
    

    That should re-create any deleted ACO's and get you up and running again.

    There is also a web-based ACL plugin available that gives you a convenient ACL backend where you can manage your ACL altogheter (set/view groups/permissions) and also sync your ACOs with a single click on the "Synchronize actions ACOs" button.