Ok, so I created two more tables:
roles:
id int primary key;
name varchar;

roles_users:
id int primary key;
role_id foreign key roles(id);
user_id foreign key users(id);

and authorization automagically figures out where to allow the
currently logged in user.
But there's one thing. When paginating list of users, how can I get at
the user's roles? User model hasAndBelongsToMany('Role') but still
role information isn't included.

    public function index() {
        $this->User->recursive = 0;
        $this->set('users', $this->paginate());
    }

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to