#5561: AclComponent problem while using getAro and getAco functions
------------------------------------------+---------------------------------
    Reporter:  nchankov                   |         Owner:         
        Type:  Bug                        |        Status:  new    
    Priority:  Medium                     |     Milestone:  1.2.x.x
   Component:  ACL (Access Control List)  |       Version:  RC3    
    Severity:  Normal                     |    Resolution:         
    Keywords:  acl                        |   Php_version:  PHP 5  
Cake_version:                             |  
------------------------------------------+---------------------------------
Comment (by nchankov):

 Found a solution, didn't check it for INI acl, but should work up to me:

 so in AclComponent class replace following functions:
 {{{
 function getAro($id) {
         return $this->_Instance->Aro->node($id);
 }
 function getAco($id) {
         return $this->_Instance->Aco->node($id);
 }
 function setAro($id) {
         return $this->Aro = $this->_Instance->Aro->node($id);
 }
 function setAco($id) {
         return $this->Aco = $this->_Instance->Aco->node($id);
 }
 }}}
 I would propose to have a function like:
 {{{
 //$type should be only Aro and Aco
 function get($type, $id) {
         return $this->_Instance->$type->node($id);
 }
 //$type should be only Aro and Aco
 function set($type, $id) {
         return $this->$type $this->_Instance->$type->node($id);
 }
 }}}

 This way it will be more generic.

 Hope it make sense.

-- 
Ticket URL: <https://trac.cakephp.org/ticket/5561#comment:1>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to