Making a User in multiple group using ACL and Auth (need to extend it
a bit), it's not so complex. In fact everything is almost there, just
2 important points :

- use inherit instead of deny when setting the authorization on action
- you can call ACL's check method by $this->Acl->check(array('Group'
=> array('id' => array(1, 2, 3 ..)), 'Users/index');

Using the 2 steps above it''s quite easy to check authorization on
different groups..

Have a look here (new one), maybe that will help you:
http://www.cakephpforum.net/index.php?showtopic=745
hth
cheers

On Jul 18, 2:41 pm, CrazyDave <[EMAIL PROTECTED]> wrote:
> Believe my Aran I've spent a lot of time trying to work out how to do
> the things I wanted without resorting to a single user inmultiple
> groups but kept running into dead ends.
>
> I was tempted to have a look at a phpgacl plugin for CakePHP but it
> doesn't appear to be activity maintained.  Plus I don't think I'm
> quite up to scratch for creating my ownACLcomponent just yet... ;)
>
> On Jul 17, 7:57 pm, aranworld <[EMAIL PROTECTED]> wrote:
>
> > I really don't think you should be holding your breath for the Cake
> > component to supportmultiplegroups per user.  So, Mark's solution of
> > writing his own version is probably the only short-term solution.
>
> > But I agree with Stinkbug that there are often times when it seems
> > likemultiplegroups are the ONLY option that will work even though
> > there may be a way to do it well without resorting to that.  Not to
> > say it isn't an important feature for some situations, but I think too
> > many people jump too quickly to the conclusion that they absolutely
> > MUST havemultiplegroups, when they don't really need it.
>
> > -Aran
>
> > On Jul 17, 11:39 am, "Mark (Germany)" <[EMAIL PROTECTED]>
> > wrote:
>
> > > i had the similar problem and ended up writing my own component/
> > > function for it
> > > and it is now hard-coded in each view
>
> > > but this makes it possible to have users in several different groups.
> > > although i lost the initial way ofACLHandling.. but coundn't find a
> > > better solution
>
> > > On 17 Jul., 17:33, CrazyDave <[EMAIL PROTECTED]> wrote:
>
> > > > Thanks Stinkbug,
>
> > > > I think I understand the approach you've taken.  It does make sense
> > > > and might probably be the way to go if CakePHP is probably not going
> > > > to go down a similar route. ;)
>
> > > > Thanks again,
> > > > Dave
>
> > > > On Jul 15, 9:01 pm, Stinkbug <[EMAIL PROTECTED]> wrote:
>
> > > > > Not sure if this will help you out or not, but I can explain what I've
> > > > > done in our application.  I thought about a way to have the same user
> > > > > under two different departments.  What I really starting thinking
> > > > > about it though, I found it wasn't necessary (at least in my case).
>
> > > > > I have something like this.
>
> > > > > Aros
> > > > > ====
> > > > > Department.1
> > > > > -User.1
> > > > > -User.2
> > > > > Department.2
> > > > > -User.3
> > > > > -User.4
>
> > > > > Acos
> > > > > ====
> > > > > Department.1
> > > > > -blog
> > > > > -page
> > > > > Department.2
> > > > > -blog
> > > > > -page
>
> > > > > Now I can give Department.1 (Aro) access to Department.1 (Aco).  Now,
> > > > > let's say User.1 (Aro) needs access to the same things that 
> > > > > Department.
> > > > > 2 (Aro) has access to.  Because all my Aros are grouped by Departments
> > > > > too...  Even though User.1 isn't a part of the Department.2group, I
> > > > > can still give User.1 access to the Aco Deparment.2.  Now User.1 has
> > > > > access to everything that Department.2 has access to.
>
> > > > > The only time I can think of where this might be a problem is if you
> > > > > wanted to give Department.2 (Aro) access to Department.3 (Aco).  User.
> > > > > 1 (Aro) won't have access to it unless you say it can. It will still
> > > > > only have access to Department.2.
>
> > > > > In your case you could set up a structure like this:
>
> > > > > Aros
> > > > > ====
> > > > > Millennium Falcon
> > > > > -Crew
> > > > > --Han
> > > > > --Chewie
> > > > > -Passangers
> > > > > --Luke
> > > > > --R2D2
>
> > > > > Acos
> > > > > ====
> > > > > Guns
> > > > > Engines
> > > > > Lounge
> > > > > Cockpit
>
> > > > > Now Crew (Aro) could have access to everything.  Passangers could have
> > > > > access to Lounge.  And R2D2 could have access to Guns and Engines.
>
> > > > > Another good way to think about...  There can't be more than one of me
> > > > > in this world.  Having more than one of me would be trouble.  I have
> > > > > access to my job and my office.  If I get fired I shouldn't have
> > > > > access to it anymore, but if there were two of me, even though I got
> > > > > fired, I might still have access to my job and office.  It's bad
> > > > > news.  The same goes for theACL.  There should never be two Hans...
> > > > > there's only one, that can have access to many different things.
>
> > > > > Hope that's not to confusing.  Hope it helps.
>
> > > > > On Jul 14, 3:34 am, CrazyDave <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hi,
>
> > > > > > I want to use theACLcomponent in CakePHP and have got things up and
> > > > > > running thanks to some blog posts by Mark Story and LemonCake.  I do
> > > > > > have a query about theACLand if it's capable of users belong to
> > > > > >multiplegroups?
>
> > > > > > I found two previous posts on the subject:
>
> > > > > >http://groups.google.com/group/cake-php/browse_thread/thread/2c219ca5...
>
> > > > > >http://groups.google.com/group/cake-php/browse_thread/thread/633e56e4...
>
> > > > > > Both state that this isn't possible with CakePHP'sACL, has this
> > > > > > changed or will this ever change?
>
> > > > > > For example (taken from phpgacl) something like this where Han is a
> > > > > > member of two groups.
>
> > > > > > Default: DENY ALL
> > > > > >   Millennium Falcon Passengers
> > > > > >     |-Crew [ALLOW: ALL]
> > > > > >     | |-Han
> > > > > >     | |-Chewie [DENY: Engines]
> > > > > >     |-Passengers [ALLOW: Lounge]
> > > > > >     | |-Jedi [ALLOW: Cockpit]
> > > > > >     | | |-Obi-wan
> > > > > >     | | |-Luke [ALLOW: Guns]
> > > > > >     | |-R2D2
> > > > > >     | |-C3PO
> > > > > >     |-Engineers [ALLOW: Engines, Guns]
> > > > > >       |-Han
> > > > > >       |-R2D2
>
> > > > > > Thanks,
> > > > > > Dave
--~--~---------~--~----~------------~-------~--~----~
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