If I get it right you want Admin section and Client section?

If so:

If you try to use ACL based app (http://book.cakephp.org/view/641/
Simple-Acl-controlled-Application),
your create two tables: users and groups (plus rest from ACL component
- http://book.cakephp.org/view/641/Simple-Acl-controlled-Application).
Each user belongs to some group, so you could have simply two groups:
admins
clients

Now, you have to define ARO - ACO association (http://book.cakephp.org/
view/648/Setting-up-permissions):

    $group =& $this->User->Group;
    //Allow admins to everything
    $group->id = 1;
    $this->Acl->allow($group, 'controllers');

    //allow clients to shop
    $group->id = 2;
    $this->Acl->deny($group, 'controllers');
    $this->Acl->allow($group, 'controllers/ShoppingCarts/
edit');
    $this->Acl->allow($group, 'controllers/ShoppingCarts/add');
    .... and so on

Actions visible for everyone (no logged in) are defined in
beforeFilter action in each controller,

function beforeFilter(){
  parent::beforFilter(); //see Cake Book tutorial for explenation of
this
  $this->Auth->allowedActions('index', 'view');
}

Some actions (defined by you) will be then served only when someone is
logged in. All actions with prefix admin_ will be served only to
admin.

Very helpful tool for automated ACO's (simply controllers' and
plugins' actions): 
http://book.cakephp.org/view/647/An-Automated-tool-for-creating-ACOs

Add to it Tip about prefix routing and You should have nice urls for
logged in users.


On Nov 25, 1:19 am, Petr Vytlačil <[email protected]> wrote:
> Hi,
> is any idea. How use AUTH for two admin sections?
> First: Admin section, when user log. can add new products, and other
> informations.
> Second: Client admin: user log. can shopping, do order, check
> order....
>
> I must use ACL or role in user and how i can do, when client login can
> view only views for orders, ... and admin user can use add products,
> kind.. but cant shopping..
>
> THX

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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to