#6153: [PATCH] Add findAllowedChildren to the ACL component
--------------------------+-------------------------------------------------
Reporter: aidan | Type: Bug
Status: new | Priority: Low
Milestone: 1.2.x.x | Component: ACL (Access Control List)
Version: 1.2 Final | Severity: Normal
Keywords: ACL | Php_version: PHP 5
Cake_version: SVN r8013 |
--------------------------+-------------------------------------------------
It is common to want to display a list of resources a user has access to.
For example, a list of Posts that the user has access to edit.
There should be a generic method that allows the user to specify the root
of the ACO tree they wish to search, what Model they wish to check, and
what ARO to check against.
I thus propose getAllowedChildren($model, $aco, $aro);
<?php
$aro = array('model' => 'User', 'foreign_key' => $this->Auth->user('id'));
$aco = 'Posts';
$fks = $this->Acl->findAllowedChildren('Paper', $aro, $aco);
$posts = $this->find('all', array('conditions' => array('id' => $fks)));
?>
I believe similar functions exist in both rails and django (but I couldn't
find them from glimpsing through the manual).
My implementation is very basic and very, very inefficient. I just whipped
it up to demonstrate proof of concept.
--
Ticket URL: <https://trac.cakephp.org/ticket/6153>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---