I'm using the CakePHP ACL CRUD system in my webapplications and i'm trying to generate some menu's based on the permissions for the user currently logged in.
I'm facing a problem which is not documented in the CakePHP manual (at least I couldn't find it). I would like to check the permissions based on the following URL-format:
$url = '/admin/users/add';
$this->Acl->check(array('User' => array('id' => 2)), $url);
I've tried to parse the URL to a array-format with Router::parse() but check() is not able to handle this format.
The second parameter of Acl->check() expects a "Array with 'model' and 'foreign_key', model object, or string value"..
What is the best way to transform my $url to a format that checks() accepts?