Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Best Way to Organize Controllers for Multiple Roles
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
lauraw  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 15:45
From: lauraw <lauraweind...@hotmail.com>
Date: Thu, 5 Nov 2009 07:45:01 -0800 (PST)
Local: Thurs 5 Nov 2009 15:45
Subject: Best Way to Organize Controllers for Multiple Roles
I'm trying to figure out the best way to organize controllers based on
user roles and could use some advice. I know there are experienced
people here who have had to deal with this already :-).

I have controller folders setup as:

member/
manager/
admin/

They all deal with products and I don't want to have one
ProductController at the controllers/ level that has all the functions
(view a product, add a product, delete a product). This is the way I'd
like to set it up:

member/product_controller - view()
manager/product_controller - add()
admin/product_controller - delete()

What is the best way to accomplish this division of controller
functionality? I know that I can modify the paths for controllers in
bootstrap.php, but if I have the same controller under multiple
locations, which one will cake find? The first in the list I assume?
The other solution I was thinking of is to name the controllers
differently, but is this the best way to do it?

mem_product_controller
mgr_product_controller
adm_product_controller

I'm new to CakePHP ... I'm not sure if this is doable with cake's MVC
naming conventions.

Thanks for your help!


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Miles J  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 19:11
From: Miles J <mileswjohn...@gmail.com>
Date: Thu, 5 Nov 2009 11:11:38 -0800 (PST)
Local: Thurs 5 Nov 2009 19:11
Subject: Re: Best Way to Organize Controllers for Multiple Roles
You can't separate controllers into folders like you can in
CodeIgniter/Zend. You would have to use prefixes, which is only
present in 1.3, which is still alpha.

Or you can create separate plugins for each member/manager/admin, but
that becomes too much.

Or you just use 1 controller, and use an ACL type system that
determines what they can and cannot do.

On Nov 5, 7:45 am, lauraw <lauraweind...@hotmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lauraw  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 22:29
From: lauraw <lauraweind...@hotmail.com>
Date: Thu, 5 Nov 2009 14:29:20 -0800 (PST)
Local: Thurs 5 Nov 2009 22:29
Subject: Re: Best Way to Organize Controllers for Multiple Roles
I'm going to be implemented/learning ACL as part of this project so
I'll go that route. Thanks, Miles!

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google