#6008: Mapactions: action => multiple crud functions
--------------------------+-------------------------------------------------
    Reporter:  mancam     |          Type:  Enhancement
      Status:  new        |      Priority:  Medium     
   Milestone:  1.2.x.x    |     Component:  Auth       
     Version:  1.2 Final  |      Severity:  Normal     
    Keywords:             |   Php_version:  n/a        
Cake_version:             |  
--------------------------+-------------------------------------------------
 Hi,

 sometimes it can be usefull if you can attach more than one crud function
 to an action.

 for eaxmple:
 {{{
 $this->Auth->mapActions(array(
         'index'=>array('create', 'read', 'update', 'delete'),
         'add'=>'create',
         'edit'=> 'update',
         'delete'=>'delete',
         'view'=>array('create', 'read', 'update', 'delete'),
         'details'=>array('create','update','delete'),
 ));
 }}}

 Suggestion for auth.php, line 486:
 {{{
 if(is_array($this->actionMap[$this->params['action']])) {
         foreach ($this->actionMap[$this->params['action']] as $key =>
 $function) {
                 if ($valid = $this->Acl->check(
                         $user,
                         $this->action(':controller'),
                         $function
                 )) break;
         }
 } else {
         $valid = $this->Acl->check(
                 $user,
                 $this->action(':controller'),
                 $this->actionMap[$this->params['action']]
         );
 }
 }}}


 kind regards,
 Manu

-- 
Ticket URL: <https://trac.cakephp.org/ticket/6008>
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