08.06 php saved
neroz
Tags add more
ACL, Controller, actions, permissions and simpleacl  
Note
Listing cotroller actions,
based on: http://www.thinkingphp.org/2007/07/12/quick-dessert-list-all-controllers-of-a-cakephp-application/ and SimpleACL.
I have accomplished something like that: http://bayimg.com/PAFEDaABF
  1.     function __controllerize($file) {
  2.         // FIXME: dorobic support dla obecnie przetwarzanego folderu
  3.         $path = Configure::getInstance()->controllerPaths[0];
  4.         $name = Inflector::camelize(r('_controller.php', '', $file));
  5.        
  6.         require_once($path . $file);
  7.         $ref = new ReflectionClass($name.'Controller');
  8.        
  9.         $actions = array();
  10.         foreach($ref->getMethods() as $method) {
  11.             if($method->isConstructor() || $method->isDestructor()) {
  12.                 continue;
  13.             }
  14.             if(substr($method->getName(), 0, 1) == '_') {
  15.                 continue;
  16.             }
  17.             if(in_array($method->getDeclaringClass()->getName(), array('Object', 'Controller', 'AppController'))) {
  18.                 continue;
  19.             }
  20.            
  21.             $perms = array();
  22.             foreach($this->groups as $group) {
  23.                 $perms[$group['Group']['id']] = $this->SimpleAcl->requestAllowed($name, $method->getName(), $group['Group']['controller_acl']);
  24.             }
  25.  
  26.             $actions[$method->getName()] = array(
  27.                'perms' => $perms
  28.             );
  29.         }
  30.        
  31.         return array(
  32.                 'name' => $name,
  33.                 'actions' => $actions
  34.         );
  35.     }
Parsed in 0.065 seconds, using GeSHi 1.0.7.14

Modify this Paste