Wednesday, September 1, 2010

Re: ACL and permissions arent working properly

If you followed the Auth and ACL examples from the handbook hes
referring to the build_acl action.


http://book.cakephp.org/view/1549/An-Automated-tool-for-creating-ACOs

On Sep 1, 10:54 am, Rob <bizarro...@gmail.com> wrote:
> Hey,
> This is my AppController
>
> class AppController extends Controller{
>         var $components = array('Acl', 'Auth', 'Session');
>         function beforeFilter(){
>                 $this->Auth->Authorize = 'actions';
>                 $this->Auth->loginAction = array('controller' => 'users', 'action'
> => 'login');
>                 $this->Auth->logoutRedirect = array('controller' => 'users',
> 'action' => 'login');
>                 $this->Auth->loginRedirect = array('controller' => 'cps', 'action'
> => 'panel');
>                 $this->Auth->actionPath = 'controllers/';
>                 $this->Auth->allowedActions = array('display');
>         }
>
> }
>
> and I don't have an initACL function, it wasn't mentioned at all in
> the tutorial I followed...I have initDB where I set allow and deny, is
> that similar?
>
>         function initDB(){
>                 $group =& $this->User->Group;
>
>                 $group->id = 2;
>                 $this->Acl->deny($group, 'controllers');
>
>                 $group->id = 3;
>                 $this->Acl->deny($group, 'controllers');
>                 $this->Acl->allow($group, 'controllers/Campaigns/add');
>                 $this->Acl->allow($group, 'controllers/Campaigns/index');
>                 $this->Acl->allow($group, 'controllers/Ads/view');
>                 $this->Acl->allow($group, 'controllers/Users/view');
>                 $this->Acl->allow($group, 'controllers/Cps/panel');
>                 $this->Acl->allow($group, 'controllers/Pages');
>
>                 echo "done";
>                 exit;
>
>         }
>
> On Sep 1, 2:39 am, "gome$" <gmo...@gmail.com> wrote:
>
> > hi,
> > It won't affect auth permanently.
> > Show me your AppControler source code and initACL function.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: