Re: cakephp 1.2 ACL problem

2007-08-24 Thread banesto

all the problem was with

var $components = array('Acl');

i did not have 's' in the 'components'

On Jul 16, 6:44 pm, "Christopher E. Franklin, Sr."
<[EMAIL PROTECTED]> wrote:
> Any idea how long these articles take to be approved?  I guess
> they(whoever they are) are checking for accuracy.
>
> On Jul 13, 7:11 am, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
> > I have written an article on 'How to useAclin1.2x' which is pending
> > approval on bakery. I don't know if you could access it, though the
> > url ishttp://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x
>
> > Let me know if it helps you.
>
> > Ketan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: cakephp 1.2 ACL problem

2007-08-23 Thread banesto

using Ketan's guide i got "class Aro not found" error. what could be
the problem? im using 1.2

On Jul 16, 6:44 pm, "Christopher E. Franklin, Sr."
<[EMAIL PROTECTED]> wrote:
> Any idea how long these articles take to be approved?  I guess
> they(whoever they are) are checking for accuracy.
>
> On Jul 13, 7:11 am, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
> > I have written an article on 'How to useAclin1.2x' which is pending
> > approval on bakery. I don't know if you could access it, though the
> > url ishttp://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x
>
> > Let me know if it helps you.
>
> > Ketan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: cakephp 1.2 ACL problem

2007-08-23 Thread banesto

Hi Ketan!

I'm having difficulties with your tutorial. I'm having this error:
"class 'Aro' not found". And i'm using cake 1.2.

if i use

$this -> Acl -> Aco -> create(array('alias' => 'controllers'));

then i get "Fatal error: Call to a member function create() on a non-
object in web/cake/app/controllers/init_acl_controller.php on line 13"

so how can i resolve this?

On Jul 13, 5:11 pm, Ketan Patel <[EMAIL PROTECTED]> wrote:
> I have written an article on 'How to useAclin1.2x' which is pending
> approval on bakery. I don't know if you could access it, though the
> url ishttp://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x
>
> Let me know if it helps you.
>
> Ketan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: cakephp 1.2 ACL problem

2007-07-16 Thread Christopher E. Franklin, Sr.

Any idea how long these articles take to be approved?  I guess
they(whoever they are) are checking for accuracy.

On Jul 13, 7:11 am, Ketan Patel <[EMAIL PROTECTED]> wrote:
> I have written an article on 'How to use Acl in 1.2x' which is pending
> approval on bakery. I don't know if you could access it, though the
> url ishttp://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x
>
> Let me know if it helps you.
>
> Ketan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: cakephp 1.2 ACL problem

2007-07-16 Thread Pillow

On 13 Lip, 16:11, Ketan Patel <[EMAIL PROTECTED]> wrote:
> I have written an article on 'How to use Acl in 1.2x' which is pending
> approval on bakery. I don't know if you could access it, though the
> url ishttp://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x
>
> Let me know if it helps you.

The problem was auth component. I was trying tu use it + custom ACL
checking. It was a bad move. I disabled Auth component, end now
everything goes as it should.

However, your article (on group as yet) is great :)

Ketan, francky06l - thanks for your replies.

Pillow


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: cakephp 1.2 ACL problem

2007-07-13 Thread Pillow

On 13 Lip, 16:11, Ketan Patel <[EMAIL PROTECTED]> wrote:
> I have written an article on 'How to use Acl in 1.2x' which is pending
> approval on bakery. I don't know if you could access it, though the
> url ishttp://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x
>
> Let me know if it helps you.
>
> Ketan

I can't access it now. I hope it will be approved soon :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: cakephp 1.2 ACL problem

2007-07-13 Thread Ketan Patel

I have written an article on 'How to use Acl in 1.2x' which is pending
approval on bakery. I don't know if you could access it, though the
url is
http://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x

Let me know if it helps you.

Ketan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: cakephp 1.2 ACL problem

2007-07-13 Thread francky06l

If have a difference in my testing for the someone user :

$this -> Acl -> Aro -> create(array('parent_id' => 2, 'alias' =>
'Someone'));

then in the check:

$this->Acl->check('Users/Someone', ...);

On Jul 13, 1:08 pm, Pillow <[EMAIL PROTECTED]> wrote:
> On 13 Lip, 11:39, francky06l <[EMAIL PROTECTED]> wrote:
>
> > Using create and save does not seem to fill up the lft /  rght fields.
>
> No, lft and rght are alright (according to MPTT rules).
>
> These are my tables:
>
> acos:
>
> ++---+---+-++--+--
> +
> | id | parent_id | model | foreign_key | alias  | lft  | rght
> |
> ++---+---+-++--+--
> +
> |  1 |  NULL |   |NULL | controllers|1 |4
> |
> |  2 | 1 |   |NULL | someController |2 |3
> |
> ++---+---+-++--+--
> +
>
> aros:
>
> ++---+---+-+--+--+--+
> | id | parent_id | model | foreign_key | alias| lft  | rght |
> ++---+---+-+--+--+--+
> |  1 |  NULL |   |NULL | Users|1 |6 |
> |  2 | 1 |   |NULL | Admin|2 |5 |
> |  3 | 2 |   |NULL | User.Someone |3 |4 |
> ++---+---+-+--+--+--+
>
> aros_acos:
>
> ++++-+---+-+-+
> | id | aro_id | aco_id | _create | _read | _update | _delete |
> ++++-+---+-+-+
> |  1 |  1 |  1 |  -1 |-1 |  -1 |  -1 |
> |  2 |  2 |  2 |   1 | 1 |   1 |   1 |
> ++++-+---+-+-+


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: cakephp 1.2 ACL problem

2007-07-13 Thread Pillow

On 13 Lip, 11:39, francky06l <[EMAIL PROTECTED]> wrote:
> Using create and save does not seem to fill up the lft /  rght fields.

No, lft and rght are alright (according to MPTT rules).

These are my tables:

acos:

++---+---+-++--+--
+
| id | parent_id | model | foreign_key | alias  | lft  | rght
|
++---+---+-++--+--
+
|  1 |  NULL |   |NULL | controllers|1 |4
|
|  2 | 1 |   |NULL | someController |2 |3
|
++---+---+-++--+--
+

aros:

++---+---+-+--+--+--+
| id | parent_id | model | foreign_key | alias| lft  | rght |
++---+---+-+--+--+--+
|  1 |  NULL |   |NULL | Users|1 |6 |
|  2 | 1 |   |NULL | Admin|2 |5 |
|  3 | 2 |   |NULL | User.Someone |3 |4 |
++---+---+-+--+--+--+

aros_acos:

++++-+---+-+-+
| id | aro_id | aco_id | _create | _read | _update | _delete |
++++-+---+-+-+
|  1 |  1 |  1 |  -1 |-1 |  -1 |  -1 |
|  2 |  2 |  2 |   1 | 1 |   1 |   1 |
++++-+---+-+-+



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: cakephp 1.2 ACL problem

2007-07-13 Thread francky06l

I did some testing, and using the same method as you did for creating
aro / aco. Actually if you create the aro / acos using the console it
works.
Using create and save does not seem to fill up the lft /  rght fields.

use the command line for creating aro such as :

cake -app 'yourapp' acl create aro / Users
cake -app 'yourapp' acl create aro Users Admin

Do the same for the acos..

However the "grant" command seems not to work, for this I used the
$this->Acl->allow / deny


On Jul 12, 8:24 pm, Pillow <[EMAIL PROTECTED]> wrote:
> On 12 Lip, 19:20, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
> > Did you check in database to see whether your AROs and ACOs are with
> > proper parent/child relationship? Or use console to check
>
> > "cake acl view aros"
>
> Yes, everything seems to be alright. Shell script outputs nice trees.
>
> > Acl works fine the way it is. Also, look in the ACL behavior, this
> > will save you the trouble from repeating yourself as it would create
> > Aros or Acos depending on setup automatically when there is a save
> > action and would delete when record is deleted, pretty slick.
>
> Hmm, thx :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: cakephp 1.2 ACL problem

2007-07-12 Thread Pillow

On 12 Lip, 19:20, Ketan Patel <[EMAIL PROTECTED]> wrote:
> Did you check in database to see whether your AROs and ACOs are with
> proper parent/child relationship? Or use console to check
>
> "cake acl view aros"

Yes, everything seems to be alright. Shell script outputs nice trees.

> Acl works fine the way it is. Also, look in the ACL behavior, this
> will save you the trouble from repeating yourself as it would create
> Aros or Acos depending on setup automatically when there is a save
> action and would delete when record is deleted, pretty slick.

Hmm, thx :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: cakephp 1.2 ACL problem

2007-07-12 Thread Ketan Patel


Pillow wrote:
> I am trying to use ACL in new 1.2.
>
> It seems to me that in check method (http://tinyurl.com/ywr9nu) on
> line 282 should be something like this:
>
> for ($i = 0; $i <= count($aroPath) - 1; $i++) {
>
> rather than:
>
> for ($i = count($aroPath) - 1; $i >= 0; $i--) {
>
>
> Now Acl is checking from the roots to leafs of AROs and ACOs trees.
> IMHO it should be done inversly.
>
> When I do something like this (Acl tables are now empty):
>
> //creating acos
>
> $this -> Acl -> Aco -> create(array('alias' => 'controllers'));
> $this -> Acl -> Aco -> save();
>
> $this -> Acl -> Aco -> create(array('alias' => 'someController',
> 'parent_id' => 1));
> $this -> Acl -> Aco -> save();
>
> //creating aros
>
> $this -> Acl -> Aro -> create(array('parent_id' => null, 'alias' =>
> 'Users'));
> $this -> Acl -> Aro -> save();
>
> $this -> Acl -> Aro -> create(array('parent_id' => 1, 'alias' =>
> 'Admin'));
> $this -> Acl -> Aro -> save();
>
> //assigning privileges
>
> $this -> Acl -> deny('Users', 'controllers');
> $this -> Acl -> allow('Users/Admin', 'someController');
>
> //creating some user who is children of Users/Admin
>
> $this -> Acl -> Aro -> create(array('parent_id' => 2, 'alias' =>
> 'User.Someone'));
> $this -> Acl -> Aro -> save();
>
> And when I do $this -> Acl -> check('User.Someone', 'someController');
> I am getting false, but I should be getting true...
>
> What do you think about it? I hope I am not wrong about the whole ACL
> idea... ;)

Did you check in database to see whether your AROs and ACOs are with
proper parent/child relationship? Or use console to check

"cake acl view aros"

Acl works fine the way it is. Also, look in the ACL behavior, this
will save you the trouble from repeating yourself as it would create
Aros or Acos depending on setup automatically when there is a save
action and would delete when record is deleted, pretty slick.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---