On Nov 8, 3:14 am, HR <[EMAIL PROTECTED]> wrote:
> Hello every one,
>
> I've searched how to use the ACL component of CakePHP 1.2 on "per
> record" situations on all places.
>
> Let me exemplify: We have a Message! Only the Author or an Admin can
> edit its data.
>
> How can we archive this using ACL? Is it fast on a thousands records
> situation?
ACL Is generally fast even on massive datasets.
However you just described 2 rules, and with 'traditional' ACL if you
have 1000s of users you need to define 1000s of ACL rules whereas in
fact there are only 2 'logical' rules.
I wrote about a means of defining owner_* rules before:
http://groups.google.com/group/cake-php/msg/348a6fef8eea84e5
The solution I wrote is/was for 1.1, but cake's Auth solution is quite
flexible, so if you define an isAuthorized method in the right place
you can put whatever logic and checks you like in it. Even though the
solution I wrote about added a couple of extra queries, operating on a
an acl-rule set an order (or 2 or 3) of magnitude smaller would
likely yield comparable or faster ACL checks compared to creating
1000s of rules. Plus, no need for an ever increasing number of acl
rules just to define your 2 'logical' rules.
That all said if you don't feel you will ever need to add exceptions
to your rules (Gerald canNOT edit his own profile; Bob AND Mary can
edit each other's profiles; admin users mayNOT edit the profile of
President Fluff <- all of which possible with whatever acl
implementation you put in place) you may find it's a lot simpler to
consider other solutions. such as if !($loggedInUserID ==
$profileUserId || $userIsAdmin) { // redirect... }
Food for thought,
hth,
AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---