10.24 php saved
JDSilveronnelly
Tags add more
acl users  
Note
This is based on code from this article: http://bakery.cakephp.org/articles/view/real-world-access-control
  1. class UsersController extends AppController {
  2.    function add_acl($link_id, $parent = null, $alias = null){
  3.        $acl = new AclComponent();
  4.        // $aro = new $acl->Aro();
  5.        // $aco = new $acl->Aco();
  6.        if ( $parent == 'null' ) $parent = null;
  7.        $acl->Aco->create( 1, null, "Everybody" );
  8.        $acl->Aro->create( 2, null, "Jeff" );
  9.        if ( $results = $acl->Aro->create( $link_id, $parent, $alias ) ){
  10.                 $this->Session->setFlash('The User has been saved');
  11.        }
  12.         // $this->redirect(array('action'=>'index'), null, true);
  13.         $this->set('results', $results );
  14.         $this->set('aro', $acl );
  15.    }
  16.  
  17. }
Parsed in 0.031 seconds, using GeSHi 1.0.7.14

Modify this Paste