To reduce the problem of writing two views, you can use elements, and
use those elements in both views for the bits that are common.

For instance I have a code snippet that includes a list that is used
in multiple views that looks like:

            echo $this->element('signup_list', array( 'slots' =>
$availableSlots ));

Seems to me that the difference would then be the the additional bits
you put in the admin view, which would protect them from the non-admin
user.

It also makes testing easier since you can log in as admin and have
the same view as a user.

On Oct 31, 10:40 am, Brenton B <[EMAIL PROTECTED]> wrote:
> Thanks everyone for the useful tips, that helps a lot, which means I
> may have to restructure some stuff.
> Mostly, I think I was getting confused by the fact that with having
> `index` and `admin_index` I ended up doing 2 different views, where
> the difference was only whether or not to include an 'edit' link in
> the list ... which all seemed redundant, because any small change I'd
> make to one, I'd have to make to the other and seemed a bit more
> efficient to have a single view with checks for if they have
> permission or not.
>
> Cheers
>
> On Oct 31, 1:49 am, Adam Royle <[EMAIL PROTECTED]> wrote:
>
> > Admin routing as more useful in a CMS-style site where there are
> > clearly two distinct areas.... display of site data, and administering
> > site data, which both could differ greatly in controller & view code,
> > rather than just acl & permissions.
>
> > Hope that clears things up.
>
> > Cheers,
> > Adam
>
> > On Oct 29, 6:33 am, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > > Quick question as to what would be the best Cake-y setup:
>
> > > So I've got a list of Users who can either be Admin, Editors, or
> > > simply Members.
> > > Members can edit their own profiles, but Admin can also edit anyone's
> > > profile (at this point Editors are just normal Members with special
> > > status).
>
> > > When it comes to admin routing, should that only be used for strictly
> > > Admins and not Members?
> > > Ex:
> > > /profiles/edit -> what Members use and there's a check that the
> > > profile matches with the member
> > > /profiles/admin_edit -> only Admin uses this.
>
> > > And how would that all work with ACL? It seems like there's a wee bit
> > > of overlap here.
>
> > > How have people set this up?
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to