Re: Acl alternative

2016-02-04 Thread sphereweb
Can you tell us how you implemented the connection to cassandra? What are 
your thoughts about cassandra vs mysql?

On Sunday, June 3, 2012 at 7:39:49 PM UTC-4, Juan Ezquerro LLanes wrote:
>
> Hi,
>
> I'm using cakephp 2.0 and cassandra as database, so i can't work with 
> default acl implementation, any suggestions,  options, ...?
>
> Thanks
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: ACL View

2015-01-16 Thread euromark
A few points:
- 
https://github.com/GWD-WEB/acl-view/blob/master/Controller/PermissoesController.php#L2
 
is an invalid use statement
- the plugin is missing test cases (which would have revealed point 1)
- you should add composer support, as this is the de facto standard at this 
point to include plugins

keep it up

Mark


Am Freitag, 16. Januar 2015 20:45:30 UTC+1 schrieb will:
>
> Hi everyone!
>
> My company released a (little) small plugin that helps management of ACL 
> Permissions on Cake.
>
> Feel free to use and send suggetions or bug reports!
>
> https://github.com/GWD-WEB/acl-view
>
> Thanks
>
> Willen Goulart
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Acl check not logged in user accessable url

2014-10-03 Thread John Andersen
Please rephrase your question or show us an example of what you can get and 
describe what you cannot get :)
Enjoy, John

On Monday, 29 September 2014 06:54:57 UTC+3, kani wrote:
>
> i can get current controller allowed actions but how get all allowed 
> actions from any controller.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: ACL - Error messages after adding new user

2013-11-25 Thread thebeardman
Ok, I've found my mistake.
I created the Aros, Acos tables before using the cake bake command. So when 
I used the AclBehavior, it was trying to use the node() function from the 
Aro's class autogenerated by Cake bake command, not the one from the 
AclBehavior.

I needed a good night sleep to finally being able to see this :/

Le dimanche 24 novembre 2013 16:20:45 UTC+1, thebeardman a écrit :
>
> Hi,
>
> I'm using CakePHP 2.4.2 and I followed the tuto to use the core Acl 
> behavior.
> I am able to create an usergroup and its Aros correctly.
> However when I'm trying to add a new user, the user is correctly inserted 
> in the User table but the Aro's not.
> I'm having the same issue as this one : 
> https://groups.google.com/forum/#!msg/cake-php/J964MBrQJ9A/_CXWk0BsSVkJbut 
> because it is a bit old, I thought I should open a new one.
>
> Here my User Model : 
> http://pastebin.com/pGc1U7S8
> Here the errors I have when trying to add a new user: 
> http://pastebin.com/UUDnxwsc
>
> As far as I understand the Acl behavior, it's like the AclBehavior object 
> never call the Aro->node() function.
>
> If I return null directly in the User model parentNode() function, it is 
> working but the I don't have the linked with the user's usergroup.
>
> How can I make it work?
>
> Thank for any advices.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ACL->allow based on aco id

2013-08-02 Thread Michael Gaiser
I have tried to pass in arrays like ("Aco"=>array("id"=>4)) but it doesn't
seem to work. Any suggestions?


On Thu, Aug 1, 2013 at 3:13 AM, Michael Gaiser  wrote:

> So I have seen a lot of examples that use the aco alias when calling
> allow() but they usually have the parent aco's alias included. For example
> 'controllers/Users'. Is it possible to call allow() and just use the Aco.id
> and the Aro.id? Thanks
>
>
> ~Michael
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Acl giving permissions on afterSave function of a Model?

2013-05-15 Thread Ciul
Hi again.

I don't if this is the correct or best way to achieve it but, ok, here I go:


*Following the Blog tutorial:*

*public function afterSave($create) {
*
*
*
*$acoNode = array(
'Post' => array('id' => $this->data['Post']['id'])*
*);*
*
*
*$aroNode = array(*
*'User' => array('id' => $this->data['Post']['user_id'])*
*);*
*
*
*
*
*$Permission = ClassRegistry::init('Permission');*
*$Permission->allow($aroNode, $acoNode);*
*}*

*What do you think?*

On Wednesday, May 15, 2013 11:38:39 AM UTC-5, Ciul wrote:
>
> Hi there everyone.
>
> I'm starting to give my first steps with Acl and it's going well until now.
>
> Ok, now, I want to give permissions to some Acos after creating an Object 
> that is an Aro.
>
> Example:
> Give permission to a User to update, delete a Post that he has just 
> created.
>
> I wanted to use the afterSave callback of the Post Model to do that but... 
> well, the Acl Behavior doesn't seem capable of such a thing, only the Acl 
> Component but well, I am in the Model not the Controller.
>
> How to achieve that?
> OR
> How would be the correct way to do that?
>
> Regards
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ACL : Group vs. User

2013-02-24 Thread CrotchFrog
In fact I have checked it out, I use that very same plugin. The demo on the 
site uses the 1.3 plugin and from all outward appearances seems to work as 
I would expect, or at least would like it to. I'm using the 2.0 version, 
not sure if there is a significant difference between the two but my setup 
does not work the exactly the same. Have you used this plugin? 

On Sunday, February 24, 2013 1:37:03 PM UTC-5, Robert Winkky wrote:
>
> Have you checked out 
> http://www.alaxos.net/blaxos/pages/view/plugin_acl_2.0 ? 
>
> On Sunday, February 24, 2013 11:02:37 AM UTC-5, CrotchFrog wrote:
>>
>> I have implemented ACL in my app and I'm regulating access using Groups, 
>> however, I would like for some users within the same group to have slightly 
>> different permissions. Has anyone been able to accomplish this? Is this 
>> even possible? It seems as though I can change permissions for both the 
>> Group as well as User, but when it comes to granting access it's one or the 
>> other and there are far too many user records to set individual permissions 
>> per user. 
>>
>> Any help is greatly appreciated. 
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ACL : Group vs. User

2013-02-24 Thread Robert Winkky
Have you checked out http://www.alaxos.net/blaxos/pages/view/plugin_acl_2.0 
? 

On Sunday, February 24, 2013 11:02:37 AM UTC-5, CrotchFrog wrote:
>
> I have implemented ACL in my app and I'm regulating access using Groups, 
> however, I would like for some users within the same group to have slightly 
> different permissions. Has anyone been able to accomplish this? Is this 
> even possible? It seems as though I can change permissions for both the 
> Group as well as User, but when it comes to granting access it's one or the 
> other and there are far too many user records to set individual permissions 
> per user. 
>
> Any help is greatly appreciated. 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ACL in helper

2013-01-15 Thread Jeremy Burns | Class Outfit
Sounds like a good approach - I'll give it a whirl. Thanks.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 13 Jan 2013, at 04:40:06, Jamie  wrote:

> How does that help? Well, you asked how to access ACL information inside your 
> plugin. That's how. As for referencing the ACL component inside of your 
> helper, while technically possible, that's not the best practice since you'd 
> be mixing the view and controller layers (since helpers live in the view 
> layer and components in the controller layer). So that's why I suggested the 
> helper.
> 
> The best method I've found, and which I've been using for a while now, is 
> actually to gather up the array of links that will be in your menu inside of 
> a component. Do all of your permissions checks there, and then set the 
> resulting array of links as a view variable. Then, use your helper to parse 
> out that array into your  menu. That allows you to keep the permission 
> checking where it (arguably) belongs, in the controller layer, while letting 
> the view layer just focus on displaying the information you give to it.
> 
> On Friday, January 11, 2013 10:09:43 PM UTC-8, Jeremy Burns wrote:
> How does that help? Why wouldn't I reference the Acl component inside my 
> current helper?
> 
> For clarity... the helper parses a config file an build up an menu that 
> contains one or many links - typically s into a . I want to be sure 
> that the current user has permissions for 'this' action before adding the 
> .
> 
> Jeremy Burns
> Class Outfit
> 
> http://www.classoutfit.com
> 
> On 12 Jan 2013, at 03:19:45, Jamie  wrote:
> 
>> Do you mean that you want to use check the user's permissions inside your 
>> plugin's helper? In that case, I would write another helper that you can use 
>> to check all of the ACL permissions.
>> 
>> On Thursday, January 10, 2013 9:21:54 PM UTC-8, Jeremy Burns wrote:
>> I have a Navigation plugin that contains a helper. It's used for creating 
>> menus dynamically. I want to check a user's permissions via ACL before 
>> adding a menu item. How can I user the ACL component inside the plugin?
>> 
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To post to this group, send email to cake...@googlegroups.com.
>> To unsubscribe from this group, send email to cake-php+u...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>  
>>  
> 
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> 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 
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>  
>  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: ACL in helper

2013-01-13 Thread lowpass
On Sat, Jan 12, 2013 at 11:40 PM, Jamie  wrote:
> How does that help? Well, you asked how to access ACL information inside
> your plugin.

I think what Jeremy was getting at was that you suggested creating
another helper, which doesn't make sense.

I agree that the permissions should be checked by the controller, and
the perms/routes passed to the view/helper. But I think this might be
complicated by the fact that this nav helper appears to get its routes
from a config file. I don't think that's a good approach, this ACL
question being a good example of why not.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: ACL in helper

2013-01-12 Thread Jamie
How does that help? Well, you asked how to access ACL information inside 
your plugin. That's how. As for referencing the ACL component inside of 
your helper, while technically possible, that's not the best practice since 
you'd be mixing the view and controller layers (since helpers live in the 
view layer and components in the controller layer). So that's why I 
suggested the helper.

The best method I've found, and which I've been using for a while now, is 
actually to gather up the array of links that will be in your menu inside 
of a component. Do all of your permissions checks there, and then set the 
resulting array of links as a view variable. Then, use your helper to parse 
out that array into your  menu. That allows you to keep the permission 
checking where it (arguably) belongs, in the controller layer, while 
letting the view layer just focus on displaying the information you give to 
it.

On Friday, January 11, 2013 10:09:43 PM UTC-8, Jeremy Burns wrote:
>
> How does that help? Why wouldn't I reference the Acl component inside my 
> current helper?
>
> For clarity... the helper parses a config file an build up an menu that 
> contains one or many links - typically s into a . I want to be sure 
> that the current user has permissions for 'this' action before adding the 
> .
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com 
>
> On 12 Jan 2013, at 03:19:45, Jamie > 
> wrote:
>
> Do you mean that you want to use check the user's permissions inside your 
> plugin's helper? In that case, I would write another helper that you can 
> use to check all of the ACL permissions.
>
> On Thursday, January 10, 2013 9:21:54 PM UTC-8, Jeremy Burns wrote:
>>
>> I have a Navigation plugin that contains a helper. It's used for creating 
>> menus dynamically. I want to check a user's permissions via ACL before 
>> adding a menu item. How can I user the ACL component inside the plugin?
>
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> cake-php+u...@googlegroups.com .
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>  
>  
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: ACL in helper

2013-01-12 Thread lowpass
You could fetch an array of routes (arrays) that the user can access
and pass it to the view. Pretty kludgy, though.

I've found that sometimes putting something into a plugin is far more
trouble than it's worth. Helpers, too, for that matter.

On Sat, Jan 12, 2013 at 1:09 AM, Jeremy Burns | Class Outfit
 wrote:
> How does that help? Why wouldn't I reference the Acl component inside my
> current helper?
>
> For clarity... the helper parses a config file an build up an menu that
> contains one or many links - typically s into a . I want to be sure
> that the current user has permissions for 'this' action before adding the
> .
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 12 Jan 2013, at 03:19:45, Jamie  wrote:
>
> Do you mean that you want to use check the user's permissions inside your
> plugin's helper? In that case, I would write another helper that you can use
> to check all of the ACL permissions.
>
> On Thursday, January 10, 2013 9:21:54 PM UTC-8, Jeremy Burns wrote:
>>
>> I have a Navigation plugin that contains a helper. It's used for creating
>> menus dynamically. I want to check a user's permissions via ACL before
>> adding a menu item. How can I user the ACL component inside the plugin?
>
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: ACL in helper

2013-01-11 Thread Jeremy Burns | Class Outfit
How does that help? Why wouldn't I reference the Acl component inside my 
current helper?

For clarity... the helper parses a config file an build up an menu that 
contains one or many links - typically s into a . I want to be sure 
that the current user has permissions for 'this' action before adding the .

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 12 Jan 2013, at 03:19:45, Jamie  wrote:

> Do you mean that you want to use check the user's permissions inside your 
> plugin's helper? In that case, I would write another helper that you can use 
> to check all of the ACL permissions.
> 
> On Thursday, January 10, 2013 9:21:54 PM UTC-8, Jeremy Burns wrote:
> I have a Navigation plugin that contains a helper. It's used for creating 
> menus dynamically. I want to check a user's permissions via ACL before adding 
> a menu item. How can I user the ACL component inside the plugin?
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> 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 
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>  
>  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: ACL in helper

2013-01-11 Thread Jamie
Do you mean that you want to use check the user's permissions inside your 
plugin's helper? In that case, I would write another helper that you can 
use to check all of the ACL permissions.

On Thursday, January 10, 2013 9:21:54 PM UTC-8, Jeremy Burns wrote:
>
> I have a Navigation plugin that contains a helper. It's used for creating 
> menus dynamically. I want to check a user's permissions via ACL before 
> adding a menu item. How can I user the ACL component inside the plugin?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: ACL renamed database table

2012-11-11 Thread iFemke
Thanks that did it!

I forgot that part, stupid mistake.

Op vrijdag 9 november 2012 19:46:13 UTC+1 schreef cricket het volgende:
>
> The table names normally follow from the model names: Group -> groups. 
> If you want to do something different you'll need to add a $useTable 
> var at a minimum. 
>
> Be sure to delete files in tmp/models folder, also. 
>
> On Fri, Nov 9, 2012 at 10:08 AM, iFemke > 
> wrote: 
> > I have followed the Simple Acl controlled Application tutorial and all 
> was 
> > working. 
> > 
> > Then I renamed the database table (which was groups) in to something 
> else 
> > (_companyname_groups). Now I have errors saying Cake can't find my 
> groups 
> > table, which is logical because I renamed it. I can't, however, find how 
> of 
> > where I can say that he has to use the new table name instead. Or do I 
> have 
> > to do all the steps again as explained in the tutorial? 
> > 
> > I hope you guys can help me! 
> > 
> > -- 
> > Like Us on FaceBook https://www.facebook.com/CakePHP 
> > Find us on Twitter http://twitter.com/CakePHP 
> > 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "CakePHP" group. 
> > To post to this group, send email to cake...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > cake-php+u...@googlegroups.com . 
> > Visit this group at http://groups.google.com/group/cake-php?hl=en. 
> > 
> > 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: ACL renamed database table

2012-11-09 Thread lowpass
The table names normally follow from the model names: Group -> groups.
If you want to do something different you'll need to add a $useTable
var at a minimum.

Be sure to delete files in tmp/models folder, also.

On Fri, Nov 9, 2012 at 10:08 AM, iFemke  wrote:
> I have followed the Simple Acl controlled Application tutorial and all was
> working.
>
> Then I renamed the database table (which was groups) in to something else
> (_companyname_groups). Now I have errors saying Cake can't find my groups
> table, which is logical because I renamed it. I can't, however, find how of
> where I can say that he has to use the new table name instead. Or do I have
> to do all the steps again as explained in the tutorial?
>
> I hope you guys can help me!
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Acl::check() the $action parameter and the default vals , what does that mean?

2012-11-08 Thread alaxos

Some explanation here: 
http://stackoverflow.com/questions/9063617/cakephp-acl-action-mode-vs-crud-mode



Le jeudi 8 novembre 2012 03:41:53 UTC+1, polutan polution at all a écrit :
>
> anybody? Please help me
>
>
> 2012/11/5 polutan polution at all >
>
>> Hello folks :)
>> I don't understand what does $action param and its default values mean? 
>> Because i can directly write $this->Acl->check("warriors/Aragorn", 
>> "ControllerNames/myMethodName") then it works, i don't need to supply 
>> $action param.
>>
>> Then if i do something like at the manual $this->Acl->check(
>> 'warriors/Aragorn', 'Weapons', 'create'); which method in my 
>> WeaponsController class categorized as 'create' ? .
>> Then suppose i have reloadAmmunition() method in my WeaponsController 
>> class. So what reloadAmmunition() is? a create or read or update or a 
>> delete? Please somebody help me, i need your enlightenment.
>>
>> Thank You :)
>>
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To post to this group, send email to cake...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> cake-php+u...@googlegroups.com .
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>  
>>  
>>
>
>
>
> -- 
> *Coklat Stroberi -- Web Dev Training Centre*
> http://www.facebook.com/pages/Coklat-Stroberi/249514251728226  (info 
> lebih lanjut)
> http://coklatstroberi.net 
> Jl. Raya Padang Luwih (Dalung) No.141 - Telp. (0361) 9006118 atau 
> 08174128301 - Badung, Bali. Sebelah timur traffic light pertigaan 
> perumahan dalung permai.
>
>
> 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Acl::check() the $action parameter and the default vals , what does that mean?

2012-11-07 Thread polutan
anybody? Please help me


2012/11/5 polutan polution at all 

> Hello folks :)
> I don't understand what does $action param and its default values mean?
> Because i can directly write $this->Acl->check("warriors/Aragorn",
> "ControllerNames/myMethodName") then it works, i don't need to supply
> $action param.
>
> Then if i do something like at the manual $this->Acl->check(
> 'warriors/Aragorn', 'Weapons', 'create'); which method in my
> WeaponsController class categorized as 'create' ? .
> Then suppose i have reloadAmmunition() method in my WeaponsController
> class. So what reloadAmmunition() is? a create or read or update or a
> delete? Please somebody help me, i need your enlightenment.
>
> Thank You :)
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>



-- 
*Coklat Stroberi -- Web Dev Training Centre*
http://www.facebook.com/pages/Coklat-Stroberi/249514251728226  (info lebih
lanjut)
http://coklatstroberi.net
Jl. Raya Padang Luwih (Dalung) No.141 - Telp. (0361) 9006118 atau
08174128301 - Badung, Bali. Sebelah timur traffic light pertigaan perumahan
dalung permai.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: ACL - Error Messages after Add New User

2012-11-07 Thread Victor Musvibe
Hi Karthi

I have the same problem as the person who posted the errors. I truncated 
the the 2 tables and still doesn't work.

Do you perhaps have another solution to this?

Thanks 

Victor

On Wednesday, 21 March 2012 19:28:17 UTC+2, karthik wrote:
>
> First truncate all data's in GROUP and USER table then add data's once 
> again. 
> Make sure whether you have linked GROUP and USER model correctly using 
> $actsAs requester. and its relations GROUP hasMany USER and USER 
> belongsTo GROUP 
>
> -karthi 
>
> On Mar 18, 9:26 am, Passivhaus Experte  
> wrote: 
> > Hi, 
> > 
> > I'm a newbie. 
> > 
> > I use the CakePHP Version 2.1.0 and followed the following 
> descriptionhttp://
> book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-cont... 
> > 
> > Currently I'm at the point "Acts As a Requester" and have the source 
> > code added to the Models User and Group. Also, I've successfully created 
> > 3 groups. When I add a user to the User table the user is created, but 
> > in the table Aros was no record is added... 
> > 
> > I am a little puzzled, hope you can help me. 
> > 
> > Error Messages: 
> > 
> --
>  
>
> > 
> > Notice (8): Array to string conversion 
> > [CORE/Cake/Model/Datasource/DboSource.php, line 436] 
> > Code Context 
> > 
> > $sql=   'node' 
> > $params =   array( 
> > (int) 0 => array( 
> > ) 
> > ) 
> > $prepareOptions =   array() 
> > $this   =   object(Mysql) {} 
> > $query  =   object(PDOStatement) {} 
> > 
> > PDOStatement::execute() - [internal], line ?? 
> > DboSource::_execute() - CORE/Cake/Model/Datasource/DboSource.php, line 
> > 436 
> > DboSource::execute() - CORE/Cake/Model/Datasource/DboSource.php, line 
> > 403 
> > DboSource::fetchAll() - CORE/Cake/Model/Datasource/DboSource.php, line 
> > 646 
> > DboSource::query() - CORE/Cake/Model/Datasource/DboSource.php, line 588 
> > Model::__call() - CORE/Cake/Model/Model.php, line 776 
> > Aro::node() - CORE/Cake/Model/Behavior/AclBehavior.php, line 88 
> > AclBehavior::node() - CORE/Cake/Model/Behavior/AclBehavior.php, line 88 
> > AclBehavior::afterSave() - CORE/Cake/Model/Behavior/AclBehavior.php, 
> > line 106 
> > ObjectCollection::trigger() - CORE/Cake/Utility/ObjectCollection.php, 
> > line 130 
> > call_user_func - [internal], line ?? 
> > CakeEventManager::dispatch() - CORE/Cake/Event/CakeEventManager.php, 
> > line 246 
> > Model::save() - CORE/Cake/Model/Model.php, line 1730 
> > UsersController::add() - APP/Controller/UsersController.php, line 68 
> > ReflectionMethod::invokeArgs() - [internal], line ?? 
> > Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 
> > 488 
> > Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 103 
> > 
> > 
> --
>  
>
> > 
> > Database Error 
> > 
> > Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have 
> > an error in your SQL syntax; check the manual that corresponds to your 
> > MySQL server version for the right syntax to use near 'node' at line 1 
> > 
> > SQL Query: node 
> > 
> > Notice: If you want to customize this error message, create 
> > app/View/Errors/pdo_error.ctp 
> > Stack Trace 
> > 
> >  CORE/Cake/Model/Datasource/DboSource.php line 436 → 
> > PDOStatement->execute(array) 
> >  CORE/Cake/Model/Datasource/DboSource.php line 403 → 
> > DboSource->_execute(string, array) 
> >  CORE/Cake/Model/Datasource/DboSource.php line 646 → 
> > DboSource->execute(string, array, array) 
> >  CORE/Cake/Model/Datasource/DboSource.php line 588 → 
> > DboSource->fetchAll(string, array, array) 
> >  CORE/Cake/Model/Model.php line 776 → DboSource->query(string, 
> > array, Aro) 
> >  CORE/Cake/Model/Behavior/AclBehavior.php line 88 → 
> > Model->__call(string, array) 
> >  CORE/Cake/Model/Behavior/AclBehavior.php line 88 → Aro->node(array) 
> >  CORE/Cake/Model/Behavior/AclBehavior.php line 106 → 
> > AclBehavior->node(User, array, string) 
> >  [internal function] → AclBehavior->afterSave(User, boolean, array) 
> >  CORE/Cake/Utility/ObjectCollection.php line 130 → 
> > call_user_func_array(array, array) 
> >  [internal function] → ObjectCollection->trigger(CakeEvent) 
> >  CORE/Cake/Event/CakeEventManager.php line 246 → 
> > call_user_func(array, CakeEvent) 
> >  CORE/Cake/Model/Model.php line 1730 → 
> > CakeEventManager->dispatch(CakeEvent) 
> >  APP/Controller/UsersController.php line 68 → Model->save(array) 
> >  [internal function] → UsersController->add() 
> >  CORE/Cake/Controller/Controller.php line 488 → 
> > ReflectionMethod->invokeArgs(UsersController, array) 
> >  CORE/Cake/Routing/Dispatcher.php line 103 → 
> > Controller->invokeAction(CakeRequest) 
> >  CORE/Cake/Routing/Dispatcher.php line 85 → 
> > Dispatcher->_invoke(UsersCo

Re: ACL - delete groups?

2012-10-18 Thread Adam Strom
Thanks, Jeremy - that's just the answer I needed.  The docs seemed to 
indicate that this type of handling would be taken care of by the Acl 
component of Cake, so thanks for clearing it up.  I appreciate the help!

Best,

Adam

On Thursday, 18 October 2012 00:49:54 UTC-4, Jeremy Burns wrote:
>
> The first thing to fix is referential integrity in your database so that a 
> group that has users cannot be deleted. If your db won't support RI (if 
> you're using MyIsam instead of InnoDB, for example) then at least put some 
> checks in your code before you do the delete. If you don't, the users 
> belong to a now vanished group. That will confuse the Acl tables as they do 
> not deploy RI out of the box (they should have relations between aros => 
> aros_acos <= acos, but they don't), and even then it's hard to restrict 
> group deletes there as the foreign key to either groups.id or users.id is 
> stored in the same field in the aros table, although you can add RI from 
> aros.parent_id => aros.id. If the group that contains the users is 
> removed from the aros table, the parent id points to an id that doesn't 
> exist and the code will explode.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com 
>
> On 18 Oct 2012, at 04:53:25, Vanja Dizdarević 
> > 
> wrote:
>
> Can you post some code maybe?
>
> On Thursday, October 18, 2012 1:25:22 AM UTC+2, Adam Strom wrote:
>>
>> Hi All -
>>
>> I've completed the Acl tutorial in the 2.0 docs and it says: "...anytime 
>> you create or delete a user/group the Aro table is updated." 
>>
>> Yet when I delete a group that has users assigned to it, any further 
>> edits to those users throws an error:
>>
>> "Error: [CakeException] AclNode::node() - Couldn't find Aro node 
>> identified by "Array
>> (
>> [Aro0.model] => User
>> [Aro0.foreign_key] => 16
>> )"
>>
>> Even if I assign them to an existing group, the update occurs within the 
>> Users table but the aros table never gets a new entry for that user.
>>
>> Any thoughts? 
>>
>> Thanks!
>>
>> Adam
>>
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> cake-php+u...@googlegroups.com .
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>  
>  
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: ACL - delete groups?

2012-10-17 Thread Jeremy Burns | Class Outfit
The first thing to fix is referential integrity in your database so that a 
group that has users cannot be deleted. If your db won't support RI (if you're 
using MyIsam instead of InnoDB, for example) then at least put some checks in 
your code before you do the delete. If you don't, the users belong to a now 
vanished group. That will confuse the Acl tables as they do not deploy RI out 
of the box (they should have relations between aros => aros_acos <= acos, but 
they don't), and even then it's hard to restrict group deletes there as the 
foreign key to either groups.id or users.id is stored in the same field in the 
aros table, although you can add RI from aros.parent_id => aros.id. If the 
group that contains the users is removed from the aros table, the parent id 
points to an id that doesn't exist and the code will explode.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 18 Oct 2012, at 04:53:25, Vanja Dizdarević  wrote:

> Can you post some code maybe?
> 
> On Thursday, October 18, 2012 1:25:22 AM UTC+2, Adam Strom wrote:
> Hi All -
> 
> I've completed the Acl tutorial in the 2.0 docs and it says: "...anytime you 
> create or delete a user/group the Aro table is updated." 
> 
> Yet when I delete a group that has users assigned to it, any further edits to 
> those users throws an error:
> 
> "Error: [CakeException] AclNode::node() - Couldn't find Aro node identified 
> by "Array
> (
> [Aro0.model] => User
> [Aro0.foreign_key] => 16
> )"
> 
> Even if I assign them to an existing group, the update occurs within the 
> Users table but the aros table never gets a new entry for that user.
> 
> Any thoughts? 
> 
> Thanks!
> 
> Adam
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> 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 
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>  
>  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: ACL - delete groups?

2012-10-17 Thread Vanja Dizdarević
Can you post some code maybe?

On Thursday, October 18, 2012 1:25:22 AM UTC+2, Adam Strom wrote:
>
> Hi All -
>
> I've completed the Acl tutorial in the 2.0 docs and it says: "...anytime 
> you create or delete a user/group the Aro table is updated." 
>
> Yet when I delete a group that has users assigned to it, any further edits 
> to those users throws an error:
>
> "Error: [CakeException] AclNode::node() - Couldn't find Aro node 
> identified by "Array
> (
> [Aro0.model] => User
> [Aro0.foreign_key] => 16
> )"
>
> Even if I assign them to an existing group, the update occurs within the 
> Users table but the aros table never gets a new entry for that user.
>
> Any thoughts? 
>
> Thanks!
>
> Adam
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: ACL - how to set user permissions along with group permission

2012-07-27 Thread rchavik


On Friday, July 27, 2012 8:39:01 PM UTC+7, bigjimmi wrote:
>
> Hi, thanks for the reply. Basically I'm wanting to add access control 
> permissions to individual db rows? but I guess that would be the same as 
> allow access to /modelname/view/1? Struggling to find any info on this.


Checkout ceeram's Authorize plugin in github. 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL - how to set user permissions along with group permission

2012-07-27 Thread bigjimmi
Hi, thanks for the reply. Basically I'm wanting to add access control 
permissions to individual db rows? but I guess that would be the same as 
allow access to /modelname/view/1? Struggling to find any info on this.

Thanks in advance

On Friday, 27 July 2012 12:21:01 UTC+1, bigjimmi wrote:
>
> Hi, I've followed the cake acl tutorials and have a working example. 
> However the tutorial is purely based around groups (it tells you to add 
> some code that disregards users and just looks at group permissions). How 
> can I keep the groups working but also override things for individual users?
>
> Thanks in advance
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL - how to set user permissions along with group permission

2012-07-27 Thread Dr. Tarique Sani
There is nothing stopping you from treating a single person as a
group. IOW the person becomes the ARO you may have to write some
additional code with if group || username kind of conditions

OTOH are you looking for row level permissions? That is a different
game altogether

HTH
Tarique

P.S. OMG too many TLAs ;-)


On Fri, Jul 27, 2012 at 4:51 PM, bigjimmi
 wrote:
> Hi, I've followed the cake acl tutorials and have a working example. However
> the tutorial is purely based around groups (it tells you to add some code
> that disregards users and just looks at group permissions). How can I keep
> the groups working but also override things for individual users?
>
> Thanks in advance
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php



-- 
=
PHP for E-Biz: http://sanisoft.com
=

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL very slow

2012-04-17 Thread Farah
Yes, all fields has index

On Tuesday, April 17, 2012 12:21:36 PM UTC-3, jeremyharris wrote:
>
> I realized after posting that the post I referenced assumes MySQL, but the 
> idea of indexing is relative nonetheless.
>
> On Tuesday, April 17, 2012 8:20:05 AM UTC-7, jeremyharris wrote:
>>
>> It's quite possible you're just missing indexes[1], which would be a huge 
>> performance problem. Also, make sure the engine is innodb.
>>
>> 1:  
>> http://blog.loadsys.com/2008/03/19/cakephp-12-tuning-the-acl-via-mysql/ 
>>
>> On Tuesday, April 17, 2012 6:00:05 AM UTC-7, Farah wrote:
>>>
>>> I'm not expert in CakePHP, but its very clear that the ACL is slow if my 
>>> tables database acos, aros and aros_acos over thousand rows.
>>>
>>> Just a simple $this->Acl->check() runs over 500 queries and its clear 
>>> that its not the acl generate that, it uses the Tree behavior to find the 
>>> specific permission.
>>>
>>> 1. I'm not using database session.
>>> 2. There are many articles on the internet talking about that, and I'm 
>>> not blaming, I'm just trying to figure out how fast my app can be.
>>>
>>> The articles
>>>
>>> 1. http://www.visuallizard.com/blog/2009/10/19/241 
>>> 2. 
>>> http://www.mainelydesign.com/blog/view/speeding-up-cakephp-acl-component
>>> 3. 
>>> http://phpknight.com/cakephp-acl-controlled-application-slow-performance-problem/
>>>
>>>
>>> I'll create a component and helper to make this faster as soon as 
>>> possible and I'll post it here.
>>>
>>> Thanks for your attention =)
>>>
>>>
>>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:

 1. Do you store sessions in database? If yes, is it the same database 
 as the one with application data? If yes, why? And why not use other 
 (memcache) storage for sessions?

 2. Stop blaming core code for slowness, until you'll be able to write 
 short example NOT using your own classes like SessionAcl etc in it, 
 especially not after your example code "snippet" above. I do have advanced 
 imagination and I'm more then just a bit scared of what and how does your 
 other custom code, used in your last loop over $acoes, where I even don't 
 know what $recursive you used and how many associations are queried along.

 Set up clean CakePHP installation, connect it to the very same database 
 like your ACL uses, and run some test code related to your doubts WITHOUT 
 your own code.

>>>
>>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:

 1. Do you store sessions in database? If yes, is it the same database 
 as the one with application data? If yes, why? And why not use other 
 (memcache) storage for sessions?

 2. Stop blaming core code for slowness, until you'll be able to write 
 short example NOT using your own classes like SessionAcl etc in it, 
 especially not after your example code "snippet" above. I do have advanced 
 imagination and I'm more then just a bit scared of what and how does your 
 other custom code, used in your last loop over $acoes, where I even don't 
 know what $recursive you used and how many associations are queried along.

 Set up clean CakePHP installation, connect it to the very same database 
 like your ACL uses, and run some test code related to your doubts WITHOUT 
 your own code.

>>>
>>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:

 1. Do you store sessions in database? If yes, is it the same database 
 as the one with application data? If yes, why? And why not use other 
 (memcache) storage for sessions?

 2. Stop blaming core code for slowness, until you'll be able to write 
 short example NOT using your own classes like SessionAcl etc in it, 
 especially not after your example code "snippet" above. I do have advanced 
 imagination and I'm more then just a bit scared of what and how does your 
 other custom code, used in your last loop over $acoes, where I even don't 
 know what $recursive you used and how many associations are queried along.

 Set up clean CakePHP installation, connect it to the very same database 
 like your ACL uses, and run some test code related to your doubts WITHOUT 
 your own code.

>>>
>>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:

 1. Do you store sessions in database? If yes, is it the same database 
 as the one with application data? If yes, why? And why not use other 
 (memcache) storage for sessions?

 2. Stop blaming core code for slowness, until you'll be able to write 
 short example NOT using your own classes like SessionAcl etc in it, 
 especially not after your example code "snippet" above. I do have advanced 
 imagination and I'm more then just a bit scared of what and how does your 
 other custom code, used in your last loop over $acoes, where I even don't 
 know what $recursive you used and how many associa

Re: ACL very slow

2012-04-17 Thread Farah
Thanks for the reply!

On Tuesday, April 17, 2012 11:16:49 AM UTC-3, stork wrote:
>
> Also, check out these projects
> http://plugins.cakephp.org/packages?query=acl
> if you do not need wheel with some special shape.
>

On Tuesday, April 17, 2012 11:16:49 AM UTC-3, stork wrote:
>
> Also, check out these projects
> http://plugins.cakephp.org/packages?query=acl
> if you do not need wheel with some special shape.
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL very slow

2012-04-17 Thread jeremyharris
I realized after posting that the post I referenced assumes MySQL, but the 
idea of indexing is relative nonetheless.

On Tuesday, April 17, 2012 8:20:05 AM UTC-7, jeremyharris wrote:
>
> It's quite possible you're just missing indexes[1], which would be a huge 
> performance problem. Also, make sure the engine is innodb.
>
> 1:  
> http://blog.loadsys.com/2008/03/19/cakephp-12-tuning-the-acl-via-mysql/ 
>
> On Tuesday, April 17, 2012 6:00:05 AM UTC-7, Farah wrote:
>>
>> I'm not expert in CakePHP, but its very clear that the ACL is slow if my 
>> tables database acos, aros and aros_acos over thousand rows.
>>
>> Just a simple $this->Acl->check() runs over 500 queries and its clear 
>> that its not the acl generate that, it uses the Tree behavior to find the 
>> specific permission.
>>
>> 1. I'm not using database session.
>> 2. There are many articles on the internet talking about that, and I'm 
>> not blaming, I'm just trying to figure out how fast my app can be.
>>
>> The articles
>>
>> 1. http://www.visuallizard.com/blog/2009/10/19/241 
>> 2. 
>> http://www.mainelydesign.com/blog/view/speeding-up-cakephp-acl-component
>> 3. 
>> http://phpknight.com/cakephp-acl-controlled-application-slow-performance-problem/
>>
>>
>> I'll create a component and helper to make this faster as soon as 
>> possible and I'll post it here.
>>
>> Thanks for your attention =)
>>
>>
>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>>
>>> 1. Do you store sessions in database? If yes, is it the same database as 
>>> the one with application data? If yes, why? And why not use other 
>>> (memcache) storage for sessions?
>>>
>>> 2. Stop blaming core code for slowness, until you'll be able to write 
>>> short example NOT using your own classes like SessionAcl etc in it, 
>>> especially not after your example code "snippet" above. I do have advanced 
>>> imagination and I'm more then just a bit scared of what and how does your 
>>> other custom code, used in your last loop over $acoes, where I even don't 
>>> know what $recursive you used and how many associations are queried along.
>>>
>>> Set up clean CakePHP installation, connect it to the very same database 
>>> like your ACL uses, and run some test code related to your doubts WITHOUT 
>>> your own code.
>>>
>>
>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>>
>>> 1. Do you store sessions in database? If yes, is it the same database as 
>>> the one with application data? If yes, why? And why not use other 
>>> (memcache) storage for sessions?
>>>
>>> 2. Stop blaming core code for slowness, until you'll be able to write 
>>> short example NOT using your own classes like SessionAcl etc in it, 
>>> especially not after your example code "snippet" above. I do have advanced 
>>> imagination and I'm more then just a bit scared of what and how does your 
>>> other custom code, used in your last loop over $acoes, where I even don't 
>>> know what $recursive you used and how many associations are queried along.
>>>
>>> Set up clean CakePHP installation, connect it to the very same database 
>>> like your ACL uses, and run some test code related to your doubts WITHOUT 
>>> your own code.
>>>
>>
>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>>
>>> 1. Do you store sessions in database? If yes, is it the same database as 
>>> the one with application data? If yes, why? And why not use other 
>>> (memcache) storage for sessions?
>>>
>>> 2. Stop blaming core code for slowness, until you'll be able to write 
>>> short example NOT using your own classes like SessionAcl etc in it, 
>>> especially not after your example code "snippet" above. I do have advanced 
>>> imagination and I'm more then just a bit scared of what and how does your 
>>> other custom code, used in your last loop over $acoes, where I even don't 
>>> know what $recursive you used and how many associations are queried along.
>>>
>>> Set up clean CakePHP installation, connect it to the very same database 
>>> like your ACL uses, and run some test code related to your doubts WITHOUT 
>>> your own code.
>>>
>>
>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>>
>>> 1. Do you store sessions in database? If yes, is it the same database as 
>>> the one with application data? If yes, why? And why not use other 
>>> (memcache) storage for sessions?
>>>
>>> 2. Stop blaming core code for slowness, until you'll be able to write 
>>> short example NOT using your own classes like SessionAcl etc in it, 
>>> especially not after your example code "snippet" above. I do have advanced 
>>> imagination and I'm more then just a bit scared of what and how does your 
>>> other custom code, used in your last loop over $acoes, where I even don't 
>>> know what $recursive you used and how many associations are queried along.
>>>
>>> Set up clean CakePHP installation, connect it to the very same database 
>>> like your ACL uses, and run some test code related to your doubts WITHOUT 
>>> your own code.

Re: ACL very slow

2012-04-17 Thread jeremyharris
It's quite possible you're just missing indexes[1], which would be a huge 
performance problem. Also, make sure the engine is innodb.

1:  http://blog.loadsys.com/2008/03/19/cakephp-12-tuning-the-acl-via-mysql/ 

On Tuesday, April 17, 2012 6:00:05 AM UTC-7, Farah wrote:
>
> I'm not expert in CakePHP, but its very clear that the ACL is slow if my 
> tables database acos, aros and aros_acos over thousand rows.
>
> Just a simple $this->Acl->check() runs over 500 queries and its clear that 
> its not the acl generate that, it uses the Tree behavior to find the 
> specific permission.
>
> 1. I'm not using database session.
> 2. There are many articles on the internet talking about that, and I'm not 
> blaming, I'm just trying to figure out how fast my app can be.
>
> The articles
>
> 1. http://www.visuallizard.com/blog/2009/10/19/241 
> 2. 
> http://www.mainelydesign.com/blog/view/speeding-up-cakephp-acl-component
> 3. 
> http://phpknight.com/cakephp-acl-controlled-application-slow-performance-problem/
>
>
> I'll create a component and helper to make this faster as soon as possible 
> and I'll post it here.
>
> Thanks for your attention =)
>
>
> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>
>> 1. Do you store sessions in database? If yes, is it the same database as 
>> the one with application data? If yes, why? And why not use other 
>> (memcache) storage for sessions?
>>
>> 2. Stop blaming core code for slowness, until you'll be able to write 
>> short example NOT using your own classes like SessionAcl etc in it, 
>> especially not after your example code "snippet" above. I do have advanced 
>> imagination and I'm more then just a bit scared of what and how does your 
>> other custom code, used in your last loop over $acoes, where I even don't 
>> know what $recursive you used and how many associations are queried along.
>>
>> Set up clean CakePHP installation, connect it to the very same database 
>> like your ACL uses, and run some test code related to your doubts WITHOUT 
>> your own code.
>>
>
> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>
>> 1. Do you store sessions in database? If yes, is it the same database as 
>> the one with application data? If yes, why? And why not use other 
>> (memcache) storage for sessions?
>>
>> 2. Stop blaming core code for slowness, until you'll be able to write 
>> short example NOT using your own classes like SessionAcl etc in it, 
>> especially not after your example code "snippet" above. I do have advanced 
>> imagination and I'm more then just a bit scared of what and how does your 
>> other custom code, used in your last loop over $acoes, where I even don't 
>> know what $recursive you used and how many associations are queried along.
>>
>> Set up clean CakePHP installation, connect it to the very same database 
>> like your ACL uses, and run some test code related to your doubts WITHOUT 
>> your own code.
>>
>
> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>
>> 1. Do you store sessions in database? If yes, is it the same database as 
>> the one with application data? If yes, why? And why not use other 
>> (memcache) storage for sessions?
>>
>> 2. Stop blaming core code for slowness, until you'll be able to write 
>> short example NOT using your own classes like SessionAcl etc in it, 
>> especially not after your example code "snippet" above. I do have advanced 
>> imagination and I'm more then just a bit scared of what and how does your 
>> other custom code, used in your last loop over $acoes, where I even don't 
>> know what $recursive you used and how many associations are queried along.
>>
>> Set up clean CakePHP installation, connect it to the very same database 
>> like your ACL uses, and run some test code related to your doubts WITHOUT 
>> your own code.
>>
>
> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>
>> 1. Do you store sessions in database? If yes, is it the same database as 
>> the one with application data? If yes, why? And why not use other 
>> (memcache) storage for sessions?
>>
>> 2. Stop blaming core code for slowness, until you'll be able to write 
>> short example NOT using your own classes like SessionAcl etc in it, 
>> especially not after your example code "snippet" above. I do have advanced 
>> imagination and I'm more then just a bit scared of what and how does your 
>> other custom code, used in your last loop over $acoes, where I even don't 
>> know what $recursive you used and how many associations are queried along.
>>
>> Set up clean CakePHP installation, connect it to the very same database 
>> like your ACL uses, and run some test code related to your doubts WITHOUT 
>> your own code.
>>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.c

Re: ACL very slow

2012-04-17 Thread stork
Also, check out these projects
http://plugins.cakephp.org/packages?query=acl
if you do not need wheel with some special shape.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL very slow

2012-04-17 Thread stork


> 1. http://www.visuallizard.com/blog/2009/10/19/241 
> 2. 
> http://www.mainelydesign.com/blog/view/speeding-up-cakephp-acl-component
> 3. 
> http://phpknight.com/cakephp-acl-controlled-application-slow-performance-problem/
>

1. 2009/10
2. 2010/05
3. 2010/06

Better use current stable CakePHP release then ~2 years old one.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL very slow

2012-04-17 Thread Farah
I'm not expert in CakePHP, but its very clear that the ACL is slow if my 
tables database acos, aros and aros_acos over thousand rows.

Just a simple $this->Acl->check() runs over 500 queries and its clear that 
its not the acl generate that, it uses the Tree behavior to find the 
specific permission.

1. I'm not using database session.
2. There are many articles on the internet talking about that, and I'm not 
blaming, I'm just trying to figure out how fast my app can be.

The articles

1. http://www.visuallizard.com/blog/2009/10/19/241 
2. http://www.mainelydesign.com/blog/view/speeding-up-cakephp-acl-component
3. 
http://phpknight.com/cakephp-acl-controlled-application-slow-performance-problem/


I'll create a component and helper to make this faster as soon as possible 
and I'll post it here.

Thanks for your attention =)


On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>
> 1. Do you store sessions in database? If yes, is it the same database as 
> the one with application data? If yes, why? And why not use other 
> (memcache) storage for sessions?
>
> 2. Stop blaming core code for slowness, until you'll be able to write 
> short example NOT using your own classes like SessionAcl etc in it, 
> especially not after your example code "snippet" above. I do have advanced 
> imagination and I'm more then just a bit scared of what and how does your 
> other custom code, used in your last loop over $acoes, where I even don't 
> know what $recursive you used and how many associations are queried along.
>
> Set up clean CakePHP installation, connect it to the very same database 
> like your ACL uses, and run some test code related to your doubts WITHOUT 
> your own code.
>

On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>
> 1. Do you store sessions in database? If yes, is it the same database as 
> the one with application data? If yes, why? And why not use other 
> (memcache) storage for sessions?
>
> 2. Stop blaming core code for slowness, until you'll be able to write 
> short example NOT using your own classes like SessionAcl etc in it, 
> especially not after your example code "snippet" above. I do have advanced 
> imagination and I'm more then just a bit scared of what and how does your 
> other custom code, used in your last loop over $acoes, where I even don't 
> know what $recursive you used and how many associations are queried along.
>
> Set up clean CakePHP installation, connect it to the very same database 
> like your ACL uses, and run some test code related to your doubts WITHOUT 
> your own code.
>

On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>
> 1. Do you store sessions in database? If yes, is it the same database as 
> the one with application data? If yes, why? And why not use other 
> (memcache) storage for sessions?
>
> 2. Stop blaming core code for slowness, until you'll be able to write 
> short example NOT using your own classes like SessionAcl etc in it, 
> especially not after your example code "snippet" above. I do have advanced 
> imagination and I'm more then just a bit scared of what and how does your 
> other custom code, used in your last loop over $acoes, where I even don't 
> know what $recursive you used and how many associations are queried along.
>
> Set up clean CakePHP installation, connect it to the very same database 
> like your ACL uses, and run some test code related to your doubts WITHOUT 
> your own code.
>

On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>
> 1. Do you store sessions in database? If yes, is it the same database as 
> the one with application data? If yes, why? And why not use other 
> (memcache) storage for sessions?
>
> 2. Stop blaming core code for slowness, until you'll be able to write 
> short example NOT using your own classes like SessionAcl etc in it, 
> especially not after your example code "snippet" above. I do have advanced 
> imagination and I'm more then just a bit scared of what and how does your 
> other custom code, used in your last loop over $acoes, where I even don't 
> know what $recursive you used and how many associations are queried along.
>
> Set up clean CakePHP installation, connect it to the very same database 
> like your ACL uses, and run some test code related to your doubts WITHOUT 
> your own code.
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL very slow

2012-04-17 Thread stork
1. Do you store sessions in database? If yes, is it the same database as 
the one with application data? If yes, why? And why not use other 
(memcache) storage for sessions?

2. Stop blaming core code for slowness, until you'll be able to write short 
example NOT using your own classes like SessionAcl etc in it, especially 
not after your example code "snippet" above. I do have advanced imagination 
and I'm more then just a bit scared of what and how does your other custom 
code, used in your last loop over $acoes, where I even don't know what 
$recursive you used and how many associations are queried along.

Set up clean CakePHP installation, connect it to the very same database 
like your ACL uses, and run some test code related to your doubts WITHOUT 
your own code.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL very slow

2012-04-17 Thread Farah
Ok, I'm sorry stork, but I if I just try put in the session all permissions 
of the controller:

$acoes = $this->Acao->find("all", array("conditions" => 
array("Controller.alias" => $controller)));
foreach ($acoes as $key => $acao) {
if (!$this->Session->check("Auth.Permissions." . 
$controller . "." . $acao["Acao"]["alias"])) {
if ($this->SessionAcl->check(array('model' => 
'Usuario', 'foreign_key' => $this->Auth->user('id')), $controller . "/" . 
$acao["Acao"]["alias"])) {
$this->Session->write("Auth.Permissions." . 
$controller . "." . $acao["Acao"]["alias"], true);
}
}
}

It takes (default) 561 queries took 1072 ms, the count of $acoes is 7, I 
don't understand why 561 queries, is too slow?

Thanks =)


On Tuesday, April 17, 2012 8:09:00 AM UTC-3, stork wrote:
>
> > Any one can help me with this ?
>
> Not me, sorry. This is example, how should NOT look code of CakePHP 
> application, controller should be as slim as possible.
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL very slow

2012-04-17 Thread stork


> Any one can help me with this ?

Not me, sorry. This is example, how should NOT look code of CakePHP 
application, controller should be as slim as possible.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL: 3 levels ARO?

2012-04-03 Thread Arnold Roa
So it will work! Great!

Thank you.

On Tue, Apr 3, 2012 at 8:57 AM, jeremyharris  wrote:
> I don't see why this wouldn't work, since Aro's are a tree anyway. For one
> of my projects, I technically have a 10 level deep Aro setup, where each
> parent group inherits its children's permissions (that is, if you are of a
> higher group you can access everything lower groups can). The same applies
> here.
>
>
> On Monday, April 2, 2012 6:24:17 PM UTC-7, Arnold wrote:
>>
>> Hi,
>>
>> Im building an App for a school managament, we have schools, each
>> school has many teachers and students.
>>
>> We need to allow each school to manage their permission for each
>> teacher and students, both globally and user-specific.
>>
>> For this requirement i think I need an ACL solution with 3 levels:
>>
>> Student  --> At this level we setup the global permission for all schools
>>    School-id  -> At this level schools can personalize their
>> permission for their students
>>        student-id  --> At this level schools can personalize they
>> student-specific permissions
>>    School-id.
>>        student-id
>>    …
>> Teacher
>>      School-id
>>          teacher-id
>>
>> This will work with cakephp ACL ?
>>
>> What do you suggest in order to implement this feature
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL: 3 levels ARO?

2012-04-03 Thread jeremyharris
I don't see why this wouldn't work, since Aro's are a tree anyway. For one 
of my projects, I technically have a 10 level deep Aro setup, where each 
parent group inherits its children's permissions (that is, if you are of a 
higher group you can access everything lower groups can). The same applies 
here.

On Monday, April 2, 2012 6:24:17 PM UTC-7, Arnold wrote:
>
> Hi,
>
> Im building an App for a school managament, we have schools, each
> school has many teachers and students.
>
> We need to allow each school to manage their permission for each
> teacher and students, both globally and user-specific.
>
> For this requirement i think I need an ACL solution with 3 levels:
>
> Student  --> At this level we setup the global permission for all schools
>School-id  -> At this level schools can personalize their
> permission for their students
>student-id  --> At this level schools can personalize they
> student-specific permissions
>School-id.
>student-id
>…
> Teacher
>  School-id
>  teacher-id
>
> This will work with cakephp ACL ?
>
> What do you suggest in order to implement this feature
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: [ACL] Disable create new aro item for user while create new user (as requester)

2012-03-25 Thread dtemes
Use bindNode in the user model to return it's group, there is information 
about "group only acl" in the cake book.

I use roles instead of groups, so in my case it looks like:

function bindNode($user) {
  return array('model' => 'Role', 'foreign_key' => 
$user['User']['role_id']);
 }

El sábado 24 de marzo de 2012 12:34:02 UTC+1, baur79 escribió:
>
> Hi,
> i have the working ACL cakephp app (group based ACL)
> i have users in group and make them ACL group-based
>
> every time a register new user it creates new ARO for user
> how can disable to creation in "aro" table, cause it make the trash rows 
> (60 000 user = 60 rows)
>
> user model
> public $actsAs = array('Acl' => array('type' => 'requester'));
>
> group model 
> public $actsAs = array('Acl' => array('type' => 'requester'));
>
>
> thanks in advance
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL warning while update user data

2012-03-25 Thread Angad Nadkarni
Hi, you have probably not added an ARO with 'model' => 'Group' and
'foreign_key' => 3.

$aro = new Aro();
$aro->create(array('parent_id' => null, 'alias' => 'groups'));
$aro->save();
$aro->create(array('model' => 'Group', 'foreign_key' => 1, 'parent_id'
=> 1, 'alias' => 'Banned'));
$aro->save();

For an example.




On Mar 24, 9:44 pm, baur79  wrote:
> Hi,
>
> i have weird warning in 2.1
> while i try to function change password for user
> current user already belong to Group.3
>
> there is no problem with logging, (ACL working fine)
>
> AclNode::node() - Couldn't find Aco node identified by "Array (
> [Aco0.model] => Group
> [Aco0.foreign_key] => 3
> )
> "
> Error: An Internal Error Has Occurred.
>
> Stack Trace
> CORE\Cake\Model\Behavior\AclBehavior.php line 88 → AclNode->node(array)
> CORE\Cake\Model\Behavior\AclBehavior.php line 106 → AclBehavior->node(User,
> array, string)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL - Error Messages after Add New User

2012-03-21 Thread karthik
First truncate all data's in GROUP and USER table then add data's once
again.
Make sure whether you have linked GROUP and USER model correctly using
$actsAs requester. and its relations GROUP hasMany USER and USER
belongsTo GROUP

-karthi

On Mar 18, 9:26 am, Passivhaus Experte 
wrote:
> Hi,
>
> I'm a newbie.
>
> I use the CakePHP Version 2.1.0 and followed the following 
> descriptionhttp://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-cont...
>
> Currently I'm at the point "Acts As a Requester" and have the source
> code added to the Models User and Group. Also, I've successfully created
> 3 groups. When I add a user to the User table the user is created, but
> in the table Aros was no record is added...
>
> I am a little puzzled, hope you can help me.
>
> Error Messages:
> --
>
> Notice (8): Array to string conversion
> [CORE/Cake/Model/Datasource/DboSource.php, line 436]
> Code Context
>
> $sql    =       'node'
> $params =       array(
>         (int) 0 => array(
>         )
> )
> $prepareOptions =       array()
> $this   =       object(Mysql) {}
> $query  =       object(PDOStatement) {}
>
> PDOStatement::execute() - [internal], line ??
> DboSource::_execute() - CORE/Cake/Model/Datasource/DboSource.php, line
> 436
> DboSource::execute() - CORE/Cake/Model/Datasource/DboSource.php, line
> 403
> DboSource::fetchAll() - CORE/Cake/Model/Datasource/DboSource.php, line
> 646
> DboSource::query() - CORE/Cake/Model/Datasource/DboSource.php, line 588
> Model::__call() - CORE/Cake/Model/Model.php, line 776
> Aro::node() - CORE/Cake/Model/Behavior/AclBehavior.php, line 88
> AclBehavior::node() - CORE/Cake/Model/Behavior/AclBehavior.php, line 88
> AclBehavior::afterSave() - CORE/Cake/Model/Behavior/AclBehavior.php,
> line 106
> ObjectCollection::trigger() - CORE/Cake/Utility/ObjectCollection.php,
> line 130
> call_user_func - [internal], line ??
> CakeEventManager::dispatch() - CORE/Cake/Event/CakeEventManager.php,
> line 246
> Model::save() - CORE/Cake/Model/Model.php, line 1730
> UsersController::add() - APP/Controller/UsersController.php, line 68
> ReflectionMethod::invokeArgs() - [internal], line ??
> Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line
> 488
> Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 103
>
> --
>
> Database Error
>
> Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have
> an error in your SQL syntax; check the manual that corresponds to your
> MySQL server version for the right syntax to use near 'node' at line 1
>
> SQL Query: node
>
> Notice: If you want to customize this error message, create
> app/View/Errors/pdo_error.ctp
> Stack Trace
>
>      CORE/Cake/Model/Datasource/DboSource.php line 436 →
> PDOStatement->execute(array)
>      CORE/Cake/Model/Datasource/DboSource.php line 403 →
> DboSource->_execute(string, array)
>      CORE/Cake/Model/Datasource/DboSource.php line 646 →
> DboSource->execute(string, array, array)
>      CORE/Cake/Model/Datasource/DboSource.php line 588 →
> DboSource->fetchAll(string, array, array)
>      CORE/Cake/Model/Model.php line 776 → DboSource->query(string,
> array, Aro)
>      CORE/Cake/Model/Behavior/AclBehavior.php line 88 →
> Model->__call(string, array)
>      CORE/Cake/Model/Behavior/AclBehavior.php line 88 → Aro->node(array)
>      CORE/Cake/Model/Behavior/AclBehavior.php line 106 →
> AclBehavior->node(User, array, string)
>      [internal function] → AclBehavior->afterSave(User, boolean, array)
>      CORE/Cake/Utility/ObjectCollection.php line 130 →
> call_user_func_array(array, array)
>      [internal function] → ObjectCollection->trigger(CakeEvent)
>      CORE/Cake/Event/CakeEventManager.php line 246 →
> call_user_func(array, CakeEvent)
>      CORE/Cake/Model/Model.php line 1730 →
> CakeEventManager->dispatch(CakeEvent)
>      APP/Controller/UsersController.php line 68 → Model->save(array)
>      [internal function] → UsersController->add()
>      CORE/Cake/Controller/Controller.php line 488 →
> ReflectionMethod->invokeArgs(UsersController, array)
>      CORE/Cake/Routing/Dispatcher.php line 103 →
> Controller->invokeAction(CakeRequest)
>      CORE/Cake/Routing/Dispatcher.php line 85 →
> Dispatcher->_invoke(UsersController, CakeRequest, CakeResponse)
>      APP/webroot/index.php line 96 → Dispatcher->dispatch(CakeRequest,
> CakeResponse)
>
> --
> Grüße Sie freundlich.
> Tim Bischoff (Indianer3c)
> Blogautor Passivhaus Expertehttp://www.passivhaus-experte.de/blog

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://g

Re: ACL manager plugin

2012-01-30 Thread Sam Sherlock
See alaxos acl plugin

- S
On 30 Jan 2012 03:47, "Justin Edwards"  wrote:

> Hello all!
>
> I am currently managing ACL by hand, and have seen a couple of projects
> that do some ACL management (croogo and quickapps I believe).   I am
> developing a framework for all of my SaaS cakephp applications that allows
> for unification of applications and centralized billing / accounting for
> the subscriber.  I've come across a few good plugins so far, and was
> wondering if there was anything already created for 2.0+ for ACL management
> as far as a GUI.
>
> What I plan on doing will be a little beyond the normal ACL.  I intend on
> creating another table (roles), which will be many to many with users, and
> each role will be linked to an array of aco ids, each record will also be
> assigned to a particular application_id so that the subscriber of the
> software for their organization (subscriber admin from the normal ACL
> related groups table) can assign roles within applications.If a user is
> assigned to that role, I plan on adding entries for that user's ARO id into
> the normal cakephp aros_acos table for the related acos.
>
> Is there anything like this already in existence, or will I have to write
> it all out completely from scratch?I haven't had time to look over
> croogo or quickapps code yet to see how they handled it, I wanted to see
> their code to get an idea of how best to get started.
>
> All of the best information I've learned so far is by looking at how other
> people were doing it.   I'm planning on releasing my code so that others
> who might want to be making business applications or software as a service
> applications can put it to good use, and maybe get some good contributions
> back.
>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL fine tuning ,again

2011-12-16 Thread Geoff Douglas
That error usually means that the User.152 is not in the Aco table. As part 
of the User Create methods, you need to make sure the Aco's get created as 
well.

See if that is the case. 

Are you trying to edit User 152, or is the logged in user User 152?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL

2011-12-12 Thread RhythmicDevil
Hi Geoff, thanks for the reply. Was trying to deny access to a
particular user/group to a controller. I had originally setup my
AppController::beforeFilter like you have shown. But when a user/group
tried to access a controller they did not have permission for they
were allowed access. If I run the Acl->check() method I can see that
the user is denied access. The reason I added all the stuff to my
beforeFilter() was because it seemed to be the only way to prevent
access to the controller.


On Dec 9, 5:26 pm, Geoff Douglas  wrote:
> Are you trying to set up your application for the first time? Or are you
> trying to create some other functionality.
> If it's the first setup, it looks like you are over thinking this a bit.
>
> $this->Auth->actionPath = 'controllers/';
> $this->Auth->authorize = 'actions';
> $this->Auth->loginAction = array('controller' => 'users', 'action' =>
> 'login','plugin'=>'');
> $this->Auth->logoutRedirect = array('controller' => 'users', 'action' =>
> 'login','plugin'=>'');
> $this->Auth->loginRedirect = array('controller' =>
> 'pages','action'=>'home','plugin'=>'');
>
> These are the lines I have in my App Controller beforeFilter(). The Auth
> component does all the "checking" for you. Once the Session is
> Authenticated you don't have to worry about it.
> I only use the Auth->check method, if I am doing something else as part of
> another process... which is not very often.
>
> Let me know.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL

2011-12-09 Thread Geoff Douglas
Are you trying to set up your application for the first time? Or are you 
trying to create some other functionality.
If it's the first setup, it looks like you are over thinking this a bit. 

$this->Auth->actionPath = 'controllers/'; 
$this->Auth->authorize = 'actions';
$this->Auth->loginAction = array('controller' => 'users', 'action' => 
'login','plugin'=>'');
$this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 
'login','plugin'=>'');
$this->Auth->loginRedirect = array('controller' => 
'pages','action'=>'home','plugin'=>'');

These are the lines I have in my App Controller beforeFilter(). The Auth 
component does all the "checking" for you. Once the Session is 
Authenticated you don't have to worry about it.
I only use the Auth->check method, if I am doing something else as part of 
another process... which is not very often.

Let me know.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL RBAC

2011-12-09 Thread RhythmicDevil
A coworker just clued me in and this is the final statement in
AppController::beforeFilter()


function beforeFilter()
{
/*
 * check(ARO, ACO, [action])
 *
 */
if ($this->Acl->check(array('model' => 'Group', 'foreign_key'
=> $this->Session->read('Auth.User.group_id')), $this->name, '*'))
{
var_dump('Allowed');
}
else
{
var_dump('Not Allowed');
}
}


On Dec 9, 10:11 am, RhythmicDevil  wrote:
> Hi all, I am working on implementing RBAC using ACL. I am really close
> but I am getting an error and I am hoping you can shed some light on
> it. I have pasted my entire ACO and ARO trees below for reference.
>
> When I run the following using the Cake console it works as expected:
>
> [swright@swright-dev app]$ cake acl check Group.4 controllers/
> Solidcores "*"
> Group.4 is allowed.
>
> *** 
> 
>
> However if I do this in my AppController::beforeFilter():
>
> var_dump('Acl Check Result',
>       $this->Acl->check(
>           'Group.' . $this->Session->read('Auth.User.group_id'),
>           'controllers/' . $this->name,
>           "*"
>         )
> );
>
> *** 
> 
>
> I get the following output in my browser:
>
> Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in
> permissions check.  Node references:
> Aro: Group.4
> Aco: controllers/Solidcores [CORE/cake/libs/controller/components/
> acl.php, line 273]
>
> string 'Acl Check Result' (length=16)
>
> boolean false
>
> *** 
> 
>
> Shouldn't I get the same result?
>
> *** 
> 
> ARO and ACO Tree dumps
>
> [swright@swright-dev app]$ cake acl view aro
> Aro tree:
> ---
>   [1] Group.4
>     [4] User.4
>     [7] User.7
>   [2] Group.5
>     [5] User.5
>   [3] Group.6
>     [6] User.6
> ---
> [swright@swright-dev app]$ cake acl view aco
> Aco tree:
> ---
>   [1] controllers
>     [2] Pages
>       [3] display
>       [4] add
>       [5] edit
>       [6] index
>       [7] view
>       [8] delete
>     [9] AnalystUi
>       [10] index
>       [11] add
>       [12] edit
>       [13] view
>       [14] delete
>     [15] ThreatCenter
>       [16] index
>       [17] add
>       [18] edit
>       [19] view
>       [20] delete
>     [21] GtiData
>       [22] index
>       [23] add
>       [24] edit
>       [25] view
>       [26] delete
>     [27] PocDemos
>       [28] index
>       [29] add
>       [30] edit
>       [31] view
>       [32] delete
>     [33] Projects
>       [34] index
>       [35] add
>       [36] edit
>       [37] view
>       [38] delete
>     [39] Products
>       [40] index
>       [41] add
>       [42] edit
>       [43] view
>       [44] delete
>     [45] Users
>       [46] login
>       [47] logout
>       [48] index
>       [49] view
>       [50] add
>       [51] edit
>       [52] delete
>     [53] Wam
>       [54] index
>       [55] add
>       [56] edit
>       [57] view
>       [58] delete
>     [59] Solidcores
>       [60] index
>       [61] processed_count
>       [62] performance
>       [63] add
>       [64] edit
>       [65] view
>       [66] delete
>     [67] ThreatVectors
>       [68] index
>       [69] add
>       [70] edit
>       [71] view
>       [72] delete
>     [73] Botnets
>       [74] index
>       [75] add
>       [76] edit
>       [77] view
>       [78] delete
>     [79] Tests
>       [80] index
>       [81] add
>       [82] edit
>       [83] view
>       [84] delete
>     [85] Groups
>       [86] index
>       [87] view
>       [88] add
>       [89] edit
>       [90] delete
>     [91] Main
>       [92] index
>       [93] add
>       [94] edit
>       [95] view
>       [96] delete
>     [97] GtiApi
>       [98] index
>       [99] add
>       [100] edit
>       [101] view
>       [102] delete
>     [103] Resources
>       [104] index
>       [105] add
>       [106] edit
>       [107] view
>       [108] delete
>     [109] Environments
>       [110] index
>       [111] add
>       [112] edit
>       [113] view
>       [114] delete
>     [115] Operations
>       [116] index
>       [117] add
>       [118] edit
>       [119] view
>       [120] delete
>     [121] Reports
>       [122] index
>       [123] add
>       [124] edit
>       [125] view
>       [126] delete
>     [127] GtiSdk
>       [128] index
>       [129] add
>       [130] edit
>       [131] view
>       [132] delete

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.or

Re: ACL + Auth = Headache

2011-12-07 Thread Justin Edwards
I did the same thing at first.



On Wed, Dec 7, 2011 at 10:33 AM, Geoff Douglas  wrote:
> When I was a newb, totally did the same thing. :) We live and we learn.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL + Auth = Headache

2011-12-07 Thread Geoff Douglas
When I was a newb, totally did the same thing. :) We live and we learn.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL + Auth = Headache

2011-12-07 Thread RhythmicDevil
Doh! Man I cant believe I missed that. Thank you Geoff. This totally
worked.

public $components = array(
'Acl',
'Session',
'Auth' => array(
'loginRedirect' => array('controller' => 'main', 'action'
=> 'index'),
'actionPath' => 'controllers/',
'allow' => array('login')
)
);





On Dec 7, 3:52 am, Geoff Douglas  wrote:
> I think what you are missing is an "allow" for the login method.
> Technically the login method needs to be publicly accessible. So, the
> line you have commented out that says:
> //$this->Auth->allow(array('*'));
>
> needs to say
> $this->Auth->allow(array('login'));
>
> This will allow an un-authenticated user to post to that method and
> login.
>
> Try something like that. Let me know what you see.
>
> On Dec 6, 8:21 am, RhythmicDevil  wrote:
>
>
>
>
>
>
>
> > I followed the instructions 
> > here:http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
> > to learn how to setup ACL and Auth. My two test attempts went smoothly
> > and worked as expected. However, now that I am trying it for real its
> > failing. I get stuck in this redirect loop and I dont understand why.
> > No matter what valid URL I enter, I get a redirect loop.
>
> > This is the beforeFilter in my AppController:
>
> >     function beforeFilter()
> >     {
> >         parent::beforeFilter();
>
> >         //$this->Auth->allow(array('*'));
>
> >         //Configure AuthComponent
> >         $this->Auth->authorize = 'actions';
> >         /*
> >          * If the user did not select a controller/action before
> > logging in, then
> >          * this controller/action willbe executed.
> >          */
> >         $this->Auth->loginAction = array('controller' => 'users',
> > 'action' => 'login');
> >         /*
> >          * Send the user here after logging out
> >          */
> >         $this->Auth->logoutRedirect = array('controller' => 'users',
> > 'action' => 'login');
> >         /*
> >          * Send the user here after logging in.
> >          */
> >         $this->Auth->loginRedirect = array('controller' => 'main',
> > 'action' => 'index');
> >     }
>
> > Here are the login() and logout() methods for my users_controller
>
> >     function login()
> >     {
> >         if ($this->Session->read('Auth.User'))
> >         {
>
> >             $this->Session->setFlash('You are logged in!');
> >             $this->redirect($this->Auth->loginRedirect, null, false);
> >         }
> >     }
>
> >     function logout()
> >     {
>
> >         exit('WTF');
>
> >         $this->Session->setFlash('Good-Bye');
> >         $this->redirect($this->Auth->logout());
> >     }
>
> > I expect if I enter:http://swright-dev.epic-cake/users/logoutIwould
> > see "WTF" on the screen. I get redirected.
>
> > This is what I see repeated in my Apache access_log:
> > 172.27.3.23 - - [06/Dec/2011:11:12:58 -0500] "GET / HTTP/1.1" 302 1
> > "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101
> > Firefox/5.0"
>
> > Nothing is generated in the Apache error_log, or Cake's error and
> > debug logs.
>
> > The only way the redirect loop stops is if I uncomment this line in
> > the beforeFilter:
> > //$this->Auth->allow(array('*'));
> > But then no Auth works obviously. Can someone please point me in the
> > right direction?
>
> > Thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL + Auth = Headache

2011-12-07 Thread Geoff Douglas
I believe you problem is that the login method is not publicly available.

change the commented out line: //$this->Auth->allow(array('*'));
to: $this->Auth->allow(array('login'));

This can be in the AppContoller or the UserController. If you put an Auth 
allow in the AppController it will apply to "login" methods in all your 
controllers, just an FYI.

Anyways, that should stop the redirect.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL + Auth = Headache

2011-12-07 Thread Geoff Douglas
I think what you are missing is an "allow" for the login method.
Technically the login method needs to be publicly accessible. So, the
line you have commented out that says:
//$this->Auth->allow(array('*'));

needs to say
$this->Auth->allow(array('login'));

This will allow an un-authenticated user to post to that method and
login.

Try something like that. Let me know what you see.


On Dec 6, 8:21 am, RhythmicDevil  wrote:
> I followed the instructions 
> here:http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
> to learn how to setup ACL and Auth. My two test attempts went smoothly
> and worked as expected. However, now that I am trying it for real its
> failing. I get stuck in this redirect loop and I dont understand why.
> No matter what valid URL I enter, I get a redirect loop.
>
> This is the beforeFilter in my AppController:
>
>     function beforeFilter()
>     {
>         parent::beforeFilter();
>
>         //$this->Auth->allow(array('*'));
>
>         //Configure AuthComponent
>         $this->Auth->authorize = 'actions';
>         /*
>          * If the user did not select a controller/action before
> logging in, then
>          * this controller/action willbe executed.
>          */
>         $this->Auth->loginAction = array('controller' => 'users',
> 'action' => 'login');
>         /*
>          * Send the user here after logging out
>          */
>         $this->Auth->logoutRedirect = array('controller' => 'users',
> 'action' => 'login');
>         /*
>          * Send the user here after logging in.
>          */
>         $this->Auth->loginRedirect = array('controller' => 'main',
> 'action' => 'index');
>     }
>
> Here are the login() and logout() methods for my users_controller
>
>     function login()
>     {
>         if ($this->Session->read('Auth.User'))
>         {
>
>             $this->Session->setFlash('You are logged in!');
>             $this->redirect($this->Auth->loginRedirect, null, false);
>         }
>     }
>
>     function logout()
>     {
>
>         exit('WTF');
>
>         $this->Session->setFlash('Good-Bye');
>         $this->redirect($this->Auth->logout());
>     }
>
> I expect if I enter:http://swright-dev.epic-cake/users/logoutI would
> see "WTF" on the screen. I get redirected.
>
> This is what I see repeated in my Apache access_log:
> 172.27.3.23 - - [06/Dec/2011:11:12:58 -0500] "GET / HTTP/1.1" 302 1
> "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101
> Firefox/5.0"
>
> Nothing is generated in the Apache error_log, or Cake's error and
> debug logs.
>
> The only way the redirect loop stops is if I uncomment this line in
> the beforeFilter:
> //$this->Auth->allow(array('*'));
> But then no Auth works obviously. Can someone please point me in the
> right direction?
>
> Thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL + Auth = Headache

2011-12-06 Thread José Lorenzo
Yes, it works because you have disabled the ACL :)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL + Auth = Headache

2011-12-06 Thread RhythmicDevil
Ok so it seems that this might be the culprit:

$this->Auth->authorize = 'actions';


If I comment out that line I dont get the redirect loop.



On Dec 6, 11:21 am, RhythmicDevil  wrote:
> I followed the instructions 
> here:http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
> to learn how to setup ACL and Auth. My two test attempts went smoothly
> and worked as expected. However, now that I am trying it for real its
> failing. I get stuck in this redirect loop and I dont understand why.
> No matter what valid URL I enter, I get a redirect loop.
>
> This is the beforeFilter in my AppController:
>
>     function beforeFilter()
>     {
>         parent::beforeFilter();
>
>         //$this->Auth->allow(array('*'));
>
>         //Configure AuthComponent
>         $this->Auth->authorize = 'actions';
>         /*
>          * If the user did not select a controller/action before
> logging in, then
>          * this controller/action willbe executed.
>          */
>         $this->Auth->loginAction = array('controller' => 'users',
> 'action' => 'login');
>         /*
>          * Send the user here after logging out
>          */
>         $this->Auth->logoutRedirect = array('controller' => 'users',
> 'action' => 'login');
>         /*
>          * Send the user here after logging in.
>          */
>         $this->Auth->loginRedirect = array('controller' => 'main',
> 'action' => 'index');
>     }
>
> Here are the login() and logout() methods for my users_controller
>
>     function login()
>     {
>         if ($this->Session->read('Auth.User'))
>         {
>
>             $this->Session->setFlash('You are logged in!');
>             $this->redirect($this->Auth->loginRedirect, null, false);
>         }
>     }
>
>     function logout()
>     {
>
>         exit('WTF');
>
>         $this->Session->setFlash('Good-Bye');
>         $this->redirect($this->Auth->logout());
>     }
>
> I expect if I enter:http://swright-dev.epic-cake/users/logoutI would
> see "WTF" on the screen. I get redirected.
>
> This is what I see repeated in my Apache access_log:
> 172.27.3.23 - - [06/Dec/2011:11:12:58 -0500] "GET / HTTP/1.1" 302 1
> "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101
> Firefox/5.0"
>
> Nothing is generated in the Apache error_log, or Cake's error and
> debug logs.
>
> The only way the redirect loop stops is if I uncomment this line in
> the beforeFilter:
> //$this->Auth->allow(array('*'));
> But then no Auth works obviously. Can someone please point me in the
> right direction?
>
> Thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL group based permission + Auth Component

2011-11-26 Thread sixthpoint
Here is my situation:

I have 4 groups:
- Administrator
- Station Manager
- Station DJ
- Basic User

They all have different permissions to different pages. But no
individual user has special permissions outside his/her group. I have
read through the cakephp documentation a few times now. I originally
leaned towards ACL after first reading the cookbook. But I am noticing
now it may be better to simply build in the permissions into the auth
component using isAuthorized(). This I imagine would increase speed
and performance on my site.

On Nov 24, 9:19 am, José Lorenzo  wrote:
> It is possible via creating a custom Authorization object, those objects
> act as plugins for the AuthComponent so you would not need any changes in
> the usual way you work with Auth. The main question is, do you really need
> ACL? I've seen lots of people wondering about ACL and after a short talk
> they realize that ACL might not be the best solution for them.
>
> Can you clarify your needs?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL group based permission + Auth Component

2011-11-24 Thread José Lorenzo
It is possible via creating a custom Authorization object, those objects 
act as plugins for the AuthComponent so you would not need any changes in 
the usual way you work with Auth. The main question is, do you really need 
ACL? I've seen lots of people wondering about ACL and after a short talk 
they realize that ACL might not be the best solution for them.

Can you clarify your needs?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL is not working for groups

2011-11-01 Thread sixthpoint
awesome response time :) thanks!

On Nov 1, 11:05 am, sixthpoint  wrote:
> I am having this exact same error, let me know if you find a solution.
>
> On Oct 31, 12:23 pm, warLog  wrote:
>
>
>
>
>
>
>
> > I want to utilise the concept of groups in ACL. I am very new to
> > cakephp, and messed up with ACL. My database tables are as follows:
> > CREATE TABLE IF NOT EXISTS `gcfa_groups` (
> >   `id` int(11) NOT NULL AUTO_INCREMENT,
> >   `name` varchar(255) NOT NULL,
> >   PRIMARY KEY (`id`)
> > );
>
> > CREATE TABLE IF NOT EXISTS `gcfa_users` (
> >   `id` int(11) NOT NULL AUTO_INCREMENT,
> >   `password` varchar(50) NOT NULL,
> >   `active` tinyint(4) NOT NULL DEFAULT '1',
> >   `email` varchar(255) DEFAULT NULL,
> >   `group_id` int(11) NOT NULL,
> >   `name` varchar(100) NOT NULL,
> >   PRIMARY KEY (`id`)
> > );
>
> > id is being used as username.
>
> > My model files are as follows:
> > class User extends AppModel {
> >         var $name = 'User';
>
> >         var $hasMany = array('UserBank', 'UserNominee', 'Payment');
> >         var $belongsTo = array(
> >                                         'Group' => array('className' => 
> > 'Group',
> >                                                                 
> > 'foreignKey' => 'group_id'
> >                                         )
> >                                 );
> >         public $actsAs = array('Acl' => array('type' => 'requester'));
>
> >         public function parentNode() {
> >                 if (!$this->id && empty($this->data)) {
> >                 return null;
> >             }
> >             $data = $this->data;
> >             if (empty($this->data) || 
> > empty($this->data['User']['group_id']))
> > {
> >                 $data = $this->read();
> >             }
>
> >             if (!$data['User']['group_id']) {
> >                 return null;
> >             } else {
> >                 $this->Group->id = $data['User']['group_id'];
> >                         $groupNode = $this->Group->node();
> >                         return array('Group' => array('id' => 
> > $groupNode[0]['Aro']
> > ['foreign_key']));
> >             }
> >         }
>
> >         public function bindNode($object) {
> >                 if (!empty($object[$this->alias]['group_id'])) {
> >                         return array('model' => 'Group', 'foreign_key' => 
> > $object[$this->alias]['group_id']);
>
> >                 }
> >         }
>
> >         function isAuthorized($user, $controller, $action) {
> >                 return true;
> >         }
>
> > }
>
> > class Group extends AppModel {
> >         public $displayField = 'name';
> >         var $hasMany = array('User');
>
> >         public $actsAs = array('Acl' => array('requester'));
>
> >         public function parentNode() {
> >                 return null;
> >         }
>
> > }
>
> > I just baked the controller and view files for these models using
> > shell. I have setup my ACL as follows:
> > id      parent_id       model   foreign_key     alias   lft     rght
> > 1       NULL    Group   1       SuperUser       1       2
> > 2       NULL    Group   2       Administrator   3       4
> > 3       NULL    Group   3       Manager                 5       6
> > 4       NULL    Group   4       Author          7       8
>
> > Whenever I am going to edit any user it is giving me error :
> > Warning (512): AclNode::node() - Couldn't find Aro node identified by
> > "Array
> > (
> >     [Aro0.model] => User
> >     [Aro0.foreign_key] => 2
> > )
> > " [CORE/Cake/Model/AclNode.php, line 179]
>
> > Do I need to make separate entry of every user in aros table? If yes,
> > then what is the use of groups in this case? If I want to bypass this
> > creation of new entry in acos table, is it possible? I think if I am
> > able to override AclBehaviour::afterSave method then I can do that.
> > I dont want to create a separate entry for every user in the ACL.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL is not working for groups

2011-11-01 Thread sixthpoint
I am having this exact same error, let me know if you find a solution.

On Oct 31, 12:23 pm, warLog  wrote:
> I want to utilise the concept of groups in ACL. I am very new to
> cakephp, and messed up with ACL. My database tables are as follows:
> CREATE TABLE IF NOT EXISTS `gcfa_groups` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `name` varchar(255) NOT NULL,
>   PRIMARY KEY (`id`)
> );
>
> CREATE TABLE IF NOT EXISTS `gcfa_users` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `password` varchar(50) NOT NULL,
>   `active` tinyint(4) NOT NULL DEFAULT '1',
>   `email` varchar(255) DEFAULT NULL,
>   `group_id` int(11) NOT NULL,
>   `name` varchar(100) NOT NULL,
>   PRIMARY KEY (`id`)
> );
>
> id is being used as username.
>
> My model files are as follows:
> class User extends AppModel {
>         var $name = 'User';
>
>         var $hasMany = array('UserBank', 'UserNominee', 'Payment');
>         var $belongsTo = array(
>                                         'Group' => array('className' => 
> 'Group',
>                                                                 'foreignKey' 
> => 'group_id'
>                                         )
>                                 );
>         public $actsAs = array('Acl' => array('type' => 'requester'));
>
>         public function parentNode() {
>                 if (!$this->id && empty($this->data)) {
>                 return null;
>             }
>             $data = $this->data;
>             if (empty($this->data) || empty($this->data['User']['group_id']))
> {
>                 $data = $this->read();
>             }
>
>             if (!$data['User']['group_id']) {
>                 return null;
>             } else {
>                 $this->Group->id = $data['User']['group_id'];
>                         $groupNode = $this->Group->node();
>                         return array('Group' => array('id' => 
> $groupNode[0]['Aro']
> ['foreign_key']));
>             }
>         }
>
>         public function bindNode($object) {
>                 if (!empty($object[$this->alias]['group_id'])) {
>                         return array('model' => 'Group', 'foreign_key' => 
> $object[$this->alias]['group_id']);
>
>                 }
>         }
>
>         function isAuthorized($user, $controller, $action) {
>                 return true;
>         }
>
> }
>
> class Group extends AppModel {
>         public $displayField = 'name';
>         var $hasMany = array('User');
>
>         public $actsAs = array('Acl' => array('requester'));
>
>         public function parentNode() {
>                 return null;
>         }
>
> }
>
> I just baked the controller and view files for these models using
> shell. I have setup my ACL as follows:
> id      parent_id       model   foreign_key     alias   lft     rght
> 1       NULL    Group   1       SuperUser       1       2
> 2       NULL    Group   2       Administrator   3       4
> 3       NULL    Group   3       Manager                 5       6
> 4       NULL    Group   4       Author          7       8
>
> Whenever I am going to edit any user it is giving me error :
> Warning (512): AclNode::node() - Couldn't find Aro node identified by
> "Array
> (
>     [Aro0.model] => User
>     [Aro0.foreign_key] => 2
> )
> " [CORE/Cake/Model/AclNode.php, line 179]
>
> Do I need to make separate entry of every user in aros table? If yes,
> then what is the use of groups in this case? If I want to bypass this
> creation of new entry in acos table, is it possible? I think if I am
> able to override AclBehaviour::afterSave method then I can do that.
> I dont want to create a separate entry for every user in the ACL.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL is not working for groups

2011-11-01 Thread warLog
Finally I got the solution. Just put following line in User model:
public $actsAs = array('Acl' => array('type' => 'requester', 'enabled'
=> false));

On Oct 31, 10:23 pm, warLog  wrote:
> I want to utilise the concept of groups in ACL. I am very new to
> cakephp, and messed up with ACL. My database tables are as follows:
> CREATE TABLE IF NOT EXISTS `gcfa_groups` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `name` varchar(255) NOT NULL,
>   PRIMARY KEY (`id`)
> );
>
> CREATE TABLE IF NOT EXISTS `gcfa_users` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `password` varchar(50) NOT NULL,
>   `active` tinyint(4) NOT NULL DEFAULT '1',
>   `email` varchar(255) DEFAULT NULL,
>   `group_id` int(11) NOT NULL,
>   `name` varchar(100) NOT NULL,
>   PRIMARY KEY (`id`)
> );
>
> id is being used as username.
>
> My model files are as follows:
> class User extends AppModel {
>         var $name = 'User';
>
>         var $hasMany = array('UserBank', 'UserNominee', 'Payment');
>         var $belongsTo = array(
>                                         'Group' => array('className' => 
> 'Group',
>                                                                 'foreignKey' 
> => 'group_id'
>                                         )
>                                 );
>         public $actsAs = array('Acl' => array('type' => 'requester'));
>
>         public function parentNode() {
>                 if (!$this->id && empty($this->data)) {
>                 return null;
>             }
>             $data = $this->data;
>             if (empty($this->data) || empty($this->data['User']['group_id']))
> {
>                 $data = $this->read();
>             }
>
>             if (!$data['User']['group_id']) {
>                 return null;
>             } else {
>                 $this->Group->id = $data['User']['group_id'];
>                         $groupNode = $this->Group->node();
>                         return array('Group' => array('id' => 
> $groupNode[0]['Aro']
> ['foreign_key']));
>             }
>         }
>
>         public function bindNode($object) {
>                 if (!empty($object[$this->alias]['group_id'])) {
>                         return array('model' => 'Group', 'foreign_key' => 
> $object[$this->alias]['group_id']);
>
>                 }
>         }
>
>         function isAuthorized($user, $controller, $action) {
>                 return true;
>         }
>
> }
>
> class Group extends AppModel {
>         public $displayField = 'name';
>         var $hasMany = array('User');
>
>         public $actsAs = array('Acl' => array('requester'));
>
>         public function parentNode() {
>                 return null;
>         }
>
> }
>
> I just baked the controller and view files for these models using
> shell. I have setup my ACL as follows:
> id      parent_id       model   foreign_key     alias   lft     rght
> 1       NULL    Group   1       SuperUser       1       2
> 2       NULL    Group   2       Administrator   3       4
> 3       NULL    Group   3       Manager                 5       6
> 4       NULL    Group   4       Author          7       8
>
> Whenever I am going to edit any user it is giving me error :
> Warning (512): AclNode::node() - Couldn't find Aro node identified by
> "Array
> (
>     [Aro0.model] => User
>     [Aro0.foreign_key] => 2
> )
> " [CORE/Cake/Model/AclNode.php, line 179]
>
> Do I need to make separate entry of every user in aros table? If yes,
> then what is the use of groups in this case? If I want to bypass this
> creation of new entry in acos table, is it possible? I think if I am
> able to override AclBehaviour::afterSave method then I can do that.
> I dont want to create a separate entry for every user in the ACL.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL and mapActions problem

2011-10-31 Thread Stollie

$this->Auth->authorize = 'actions';
should have been.
$this->Auth->authorize = 'crud';

On 29 okt, 14:51, Stollie  wrote:
> Hello all :)
>
> I have a problem with the ACL en Auth mapActions  function. I can't
> set the rights (read, edit, add, delete) to each function in de
> controller as I want. With the plugin I use I have to set all the
> right to true to even view a dashboard page at the page controller.
>
> So want I'm using.
> CakePHP 1.3.13 and a plugin to manage the 
> ACL,https://github.com/interlock/acl_plugin.
>
> I build the acos list with the build_acl function provided in the cake
> book. The rights I want to mange by groups so I have set that up in
> the models of users en goups.
>
> I have the following code at my pages controller:
>         function beforeFilter() {
>                 parent::beforeFilter();
>                 $this->Auth->mapActions(
>                         array(
>                                 'read' => array('display','dashboard')
>                         )
>                 );
>         }
>
> By setting this it should be able to set read to true in my aros_acos
> row for the Pages controller, right?
> controllers > Pages    delete -> false update -> false  read -> true
> create -> false.
>
> I did this for my editors group, but I still cant view this dashboard
> as an editor. I get an end less refresh so the browser stops it.
> Probably to refresh to the login page. When I set all right true I can
> see the page.
>
> The code is avaible here to 
> view.https://bitbucket.org/Davidvdv/sociale-kaart/src/bef7409f36b1/app
>
> What should I change to make this work?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Acl and Cakephp 2.0

2011-10-27 Thread caggia
Nevermind.

And never create some models called Aco.php, Aro.php, ArosAco.php.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: acl tutorial aros and acos tables

2011-09-11 Thread Almacenamiento Almacenamiento
Yes, you can also add in the controller, but is otherwise and is somewhat
harder to remember ..

2011/9/11 elija 

> One of the DOH! moments.
>
> In case anyone else is this much of an idiot, the code in 11.2.4 Acts
> As a Requester is for the models, not the controllers.
>
> On Sep 11, 5:54 pm, elija  wrote:
> > Moving to the next page, I see that acos isn't automatically populated
> > but in my case neither is aros. I've gone through the tutorial again
> > and can't see anything i've missed.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: acl tutorial aros and acos tables

2011-09-11 Thread elija
One of the DOH! moments.

In case anyone else is this much of an idiot, the code in 11.2.4 Acts
As a Requester is for the models, not the controllers.

On Sep 11, 5:54 pm, elija  wrote:
> Moving to the next page, I see that acos isn't automatically populated
> but in my case neither is aros. I've gone through the tutorial again
> and can't see anything i've missed.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: acl tutorial aros and acos tables

2011-09-11 Thread elija
Moving to the next page, I see that acos isn't automatically populated
but in my case neither is aros. I've gone through the tutorial again
and can't see anything i've missed.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL login -> forward to some kind of main-menue site?

2011-07-31 Thread SpazzyV
I believe that you would place the $this->Auth-
>loginRedirect(array('controller' => 'controller_name', 'action' =>
'action_name', $options)); in your the controller that is responsible
for your Authentication. This would force a login redirect after a
successful login. The only time this does not effectively work is if
the visitor is coming to a link to somewhere in your site as CakePHP
keeps that information for sending the user to their requested
location.

If you wanted to force a user to go to this main-menue-site no matter
what, you could add $this->Auth->autoRedirect = false; to the
beforeFilter of the controller responsible for your Authentication.

I am fairly new myself, but I believe this should work to accomplish
what you asked about.

-spazzyv

On Jul 27, 1:45 pm, mivogtGermanyLU  wrote:
> .. it's me again seeking some help and advice @ the group
>
> I added a very basic ACL to my cake app using the login() inside my
> users-controller
>
> after logging in I would like to get some redirection to a main-menue-
> site (i.e. ./rootdir/mainmenue.php)
>
> how and where to set the code for redirection?
>
> Thanks in advance
>
> CU
>
> Michael

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Acl and bindNode

2011-07-21 Thread Femi Fadeyi
I have this same issue but while reading through this thread, it just seems 
to come to an end without a good resolution. I tried the work-around 
suggested by Parallel 32 but it hasn't changed anything for me. Does anyone 
have any suggestions about how to go about this?

Thanks!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL issue

2011-06-18 Thread Felix Fennell
Hi Don,

Sorry for taking so long to reply (study commitments) basically your suggestion 
works brilliantly - I'm only annoyed I didn't realise your suggestion myself.

Thanks again for saving me a lot of agro :) 
--Felix
[My e-mail load: http://courteous.ly/AXc5sh]


On Thursday, 5 May 2011 at 23:49, dreamingmind wrote:

> Felix,
> 
> I'm not aware of anything that would prevent a User from having
> several connections into the aros table. You have three fields in aros
> that can potentially play a role in connecting a user to an aros node:
> alias
> model
> foreign_key
> 
> If you had a president that was User.id=12, you could easily have
> several records that read Aros.model='User' Aros.foreign_key=12 and
> that were each children of different aros parents (or you could use
> alias to do the job). Once could be a child of President, another the
> child of Instructor/Theory.
> 
> Each child would have different acos permissions and your
> authentication check would just have to look out for the multiple
> permissions.
> 
> So let's say you set alia to a concatenation of model and id like some
> of the tutorials do, your aros tree could look like this:
> 
>  Overlord (a master account)
> - Committee
> - President
> - User::12
> - Treasurer
> - etc.
> - Instructors
> - Practical
> - Theory
> - User::12
> - Trainees
> 
> Regards,
> Don
> 
> On May 4, 2:35 pm, Felix  (http://felixfennell.co.uk)> wrote:
> > Hello everyone,
> > 
> > I have a query regarding how to structure the ACL system in my app.
> > 
> > Basically i'm creating a management app for a diving club. The club
> > has three broad groups,
> > 
> > - Instructors
> > - Trainees
> > - Committee
> > 
> > The ACL tree looks like this at the moment
> > 
> > - Sebastian (name of site)
> >  Overlord (a master account)
> > - Committee
> > - President
> > - Treasurer
> > - etc.
> > - Instructors
> > - Practical
> > - Theory
> > - Trainees
> > 
> > Each position above is a group (name, description) which have many to
> > one relationships with a user (username, password, name).
> > 
> > The above system works fine except for one problem. Committee members
> > are always either an instructor or trainee, therefore they need to be
> > assigned to two groups (instructor/trainee AND the relevant committee
> > position).
> > 
> > Basically I need to place a user into two levels in the tree which
> > aren't related to each other hierarchically.
> > 
> > As far as I know this isn't possible with Cake's ACL component unless
> > theres something I've missed. I know the relationship between groups
> > -- users needs changing to a HABTM relationship but I'm unsure how ACL
> > treats these.
> > 
> > Has anyone come across this sort of problem before and able to outline
> > their solution, or have I been an idiot and missed something really
> > obvious.
> > 
> > Sorry for such a long message, I didn't want to miss anything out -
> > thanks in advance,
> > 
> > --Felix Fennell
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: acl for dummies?

2011-05-29 Thread Phang Mulianto
why not try use phpgacl..there is plugin component for cake..
On May 29, 2011 3:21 AM, "dreamingmind"  wrote:
> Michael,
>
> Non-expert reply:
> After fiddling with ACL for a while I'll say, yes it can do all you
> want. The aco entries can represent anything you want them to,
> controllers, actions, individual db records, tabes, urls... Aros can
> likewise represent anything you choose, users, controllers, actions,
> ip adresses...
>
> The permission table will hook up the allowable combinations. And
> since both aros and acos are in a tree structure you can set up any
> grouping or nesting that serves your needs.
>
> It is worth noting that there are two ways to identify an aro or aco
> node, by alias or by table and id. Ponder the value of these two ways
> of identifying a requestor or controlled item.
>
> As to the specifics of implementing your system... I can't be too
> specific because I'm stilling trying to sort this out. It seems you
> can always resort to a kind of brute force approach. At the critical
> point in your logic you test: does this aro have permission to access
> this aco?
>
> This is the area where I find the tutorials a bit vague. They assume
> that there is always going to be a standard pattern for testing. User
> to action or user to crud function on a table. Possibly because my
> thinking is too fuzzy to build my apps cleanly or possibly because
> this ideal situation is not realistic, I have found it a bit confusing
> decide what testing mode to use and where to have the checks made.
>
> You are probably going to need to build some before and after save
> code to make sure proper permissions are set up as things grow. A
> simple case from tutorials: when a user registers, the save code could
> make the new user aro record and an aco entry and give them permission
> to access their own db record.
>
> In your case, the work product of a company employee on a project
> might need to be listed as a child aco in a collection that was
> accessible to managers of that company.
>
> Regards,
> Don
>
> On May 28, 3:54 pm, mivogtGermanyLU  wrote:
>> Hi there,
>>
>> after spending some hours of reading the chapert about acl/aro/acro in
the
>> cake books and the cake homepage I am still or even more confused about
the
>> topic.
>> I understood the meaning of a tree containing the rights but I am
absolute
>> not sure about if it matches my needs or even on how to realize it in my
>> app.
>>
>> So any helping comment is welcome. Linked full tutorials would be great,
>> too.
>>
>> My app consists of a set of MVC stuff to register services grated by
users
>> to be manged from users to be done by users for users with some hierachy
in
>> background.
>> So there needs to be a superadmin to setup the users in all levels
>> I need granters to grant projects
>> I need some to set up the jobs getters and workers
>> etc
>>
>> and in the meaning of some safety the i.e. workers shokld not be able to
>> change or delete granted jobs etc
>>
>> so basically I need to limit the actions/views allowed to a specific
logged
>> in users (after login using auth component)
>> secondly I need to limit the datasets shown to a user based on his role
and
>> the linked models content
>>
>> i.e.
>> 2 company are granting services to be done for customers with no need to
>> know each other or  the others customers
>> if a company grants a service for a customer a service-company is named
to
>> fullfill it. So the C sets up the job to be done and the company to do
the
>> job
>> The servicecompany will have staffs getting some kind of tickes with jobs
to
>> be done and the staff will need to fill a timereport linked to a granted
job
>> (containing the job_id dthe granterid, the service_id datwe,time etc)
with
>> the limitation he wont be able to see jobs done for the customer by
others
>> ...
>>
>> to me it looks a bit difficult to split it up into roles only
>> maybe I need some kind of data-limiting functions, too. Any chance to get
it
>> done by the acl or will I need to add some conditions in my find() inside
>> the controllers?
>>
>> Thanks in advance
>>
>> Michael
>
> --
> Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
at http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: acl for dummies?

2011-05-28 Thread dreamingmind
Michael,

Non-expert reply:
After fiddling with ACL for a while I'll say, yes it can do all you
want. The aco entries can represent anything you want them to,
controllers, actions, individual db records, tabes, urls... Aros can
likewise represent anything you choose, users, controllers, actions,
ip adresses...

The permission table will hook up the allowable combinations. And
since both aros and acos are in a tree structure you can set up any
grouping or nesting that serves your needs.

It is worth noting that there are two ways to identify an aro or aco
node, by alias or by table and id. Ponder the value of these two ways
of identifying a requestor or controlled item.

As to the specifics of implementing your system... I can't be too
specific because I'm stilling trying to sort this out. It seems you
can always resort to a kind of brute force approach. At the critical
point in your logic you test: does this aro have permission to access
this aco?

This is the area where I find the tutorials a bit vague. They assume
that there is always going to be a standard pattern for testing. User
to action or user to crud function on a table. Possibly because my
thinking is too fuzzy to build my apps cleanly or possibly because
this ideal situation is not realistic, I have found it a bit confusing
decide what testing mode to use and where to have the checks made.

You are probably going to need to build some before and after save
code to make sure proper permissions are set up as things grow. A
simple case from tutorials: when a user registers, the save code could
make the new user aro record and an aco entry and give them permission
to access their own db record.

In your case, the work product of a company employee on a project
might need to be listed as a child aco in a collection that was
accessible to managers of that company.

Regards,
Don

On May 28, 3:54 pm, mivogtGermanyLU  wrote:
> Hi there,
>
> after spending some hours of reading the chapert about acl/aro/acro in the
> cake books and the cake homepage I am still or even more confused about the
> topic.
> I understood the meaning of a tree containing the rights but I am absolute
> not sure about if it matches my needs or even on how to realize it in my
> app.
>
> So any helping comment is welcome. Linked full tutorials would be great,
> too.
>
> My app consists of a set of MVC stuff to register services grated by users
> to be manged from users to be done by users for users with some hierachy in
> background.
> So there needs to be a superadmin to setup the users in all levels
> I need granters to grant projects
> I need some to set up the jobs getters and workers
> etc
>
> and in the meaning of some safety the i.e. workers shokld not be able to
> change or delete granted jobs etc
>
> so basically I need to limit the actions/views allowed to a specific logged
> in users (after login using auth component)
> secondly I need to limit the datasets shown to a user based on his role and
> the linked models content
>
> i.e.
> 2 company are granting services to be done for customers with no need to
> know each other or  the others customers
> if a company grants a service for a customer a service-company is named to
> fullfill it. So the C sets up the job to be done and the company to do the
> job
> The servicecompany will have staffs getting some kind of tickes with jobs to
> be done and the staff will need to fill a timereport linked to a granted job
> (containing the job_id dthe granterid, the service_id datwe,time etc) with
> the limitation he wont be able to see jobs done for the customer by others
> ...
>
> to me it looks a bit difficult to split it up into roles only
> maybe I need some kind of data-limiting functions, too. Any chance to get it
> done by the acl or will I need to add some conditions in my find() inside
> the controllers?
>
> Thanks in advance
>
> Michael

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL issue

2011-05-05 Thread dreamingmind
Felix,

I'm not aware of anything that would prevent a User from having
several connections into the aros table. You have three fields in aros
that can potentially play a role in connecting a user to an aros node:
alias
model
foreign_key

If you had a president that was User.id=12, you could easily have
several records that read Aros.model='User' Aros.foreign_key=12 and
that were each children of different aros parents (or you could use
alias to do the job). Once could be a child of President, another the
child of Instructor/Theory.

Each child would have different acos permissions and your
authentication check would just have to look out for the multiple
permissions.

So let's say you set alia to a concatenation of model and id like some
of the tutorials do, your aros tree could look like this:

 Overlord (a master account)
- Committee
- President
- User::12
- Treasurer
- etc.
- Instructors
- Practical
- Theory
- User::12
- Trainees

Regards,
Don

On May 4, 2:35 pm, Felix  wrote:
> Hello everyone,
>
> I have a query regarding how to structure the ACL system in my app.
>
> Basically i'm creating a management app for a diving club. The club
> has three broad groups,
>
> - Instructors
> - Trainees
> - Committee
>
> The ACL tree looks like this at the moment
>
> - Sebastian (name of site)
>  Overlord (a master account)
> - Committee
> - President
> - Treasurer
> - etc.
> - Instructors
> - Practical
> - Theory
> - Trainees
>
> Each position above is a group (name, description) which have many to
> one relationships with a user (username, password, name).
>
> The above system works fine except for one problem. Committee members
> are always either an instructor or trainee, therefore they need to be
> assigned to two groups (instructor/trainee AND the relevant committee
> position).
>
> Basically I need to place a user into two levels in the tree which
> aren't related to each other hierarchically.
>
> As far as I know this isn't possible with Cake's ACL component unless
> theres something I've missed. I know the relationship between groups
> -- users needs changing to a HABTM relationship but I'm unsure how ACL
> treats these.
>
> Has anyone come across this sort of problem before and able to outline
> their solution, or have I been an idiot and missed something really
> obvious.
>
> Sorry for such a long message, I didn't want to miss anything out -
> thanks in advance,
>
> --Felix Fennell

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL: extending the DbAcl class

2011-04-11 Thread ojonam
Hi Tim,

thanks for your answer, that's what I was looking for :). Wanted to
specify, in case someone else is interested, that you need to include
the line

App::import('Core','Acl');

in my_db_acl.php.

Cheers,
ojonam

On Apr 8, 5:00 pm, Tilen Majerle  wrote:
> in app/app_controller.php do this before class AppController starts...
>
> 
> App::import('Lib', 'MyDbAcl');
> class AppController extends Controller //this you should already have
> ...
> ...
> ...
> ?>
>
> place your my_db_acl.php file inside app/libs folder...:)
>
> --
> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> 2011/4/8 ojonam 
>
> > Hello all,
>
> > due to some specific needs for my app with respect to Acl, I have
> > extended the DbAcl class which resides in cake/libs/controllers/
> > components/acl.php :
>
> > MyDbAcl extends DbAcl { //lots of code }
>
> > I do not want this code to reside in the above file, because it is
> > application specific, and therefore has no place in the cake
> > libraries. The problem is, however, in core.php, I have to specify
> > which class to use in the following manner:
>
> > Configure::write('Acl.classname', 'MyDbAcl');
>
> > When I do this, I get an error message on the browser, telling me that
> > MyDbAcl has not been defined in the acl.php file.
>
> > What are my options here? The worst case is obviously to include the
> > MyDbAcl code in the libs, but it isn't really very neat.
>
> > Cheers,
> > ojonam
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Acl->allow() Troubles

2011-04-08 Thread DragonFlyEye
Wait. Dang. I just figured it out. Thanks for listening, people.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL: extending the DbAcl class

2011-04-08 Thread Tilen Majerle
in app/app_controller.php do this before class AppController starts...



place your my_db_acl.php file inside app/libs folder...:)

--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/4/8 ojonam 

> Hello all,
>
> due to some specific needs for my app with respect to Acl, I have
> extended the DbAcl class which resides in cake/libs/controllers/
> components/acl.php :
>
> MyDbAcl extends DbAcl { //lots of code }
>
> I do not want this code to reside in the above file, because it is
> application specific, and therefore has no place in the cake
> libraries. The problem is, however, in core.php, I have to specify
> which class to use in the following manner:
>
> Configure::write('Acl.classname', 'MyDbAcl');
>
> When I do this, I get an error message on the browser, telling me that
> MyDbAcl has not been defined in the acl.php file.
>
> What are my options here? The worst case is obviously to include the
> MyDbAcl code in the libs, but it isn't really very neat.
>
> Cheers,
> ojonam
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: acl :: deny access to PostsController

2011-03-16 Thread AKO
Ok, so after days of debugging I finally found the answer..

Cakephp's auth component located in the cake/controller/components/
auth.php.

Line 312 tells me the sad news that the start-up function is not
properly instantiated, when controller is named 'tests'..

I called my controller tests1 and it worked !!

My god! had i only read this days ago :)

Hope I can spare others for the same mistake..

AKO

On Mar 16, 12:33 pm, AKO  wrote:
> Im still playing around with this acl-tutorial and followed it with
> users,groups,posts,widgets and got it working without problems..
>
> As soon as I shift from from 'posts' to 'tests' the auth and vcl
> suddenly doesnt apply by magic and you can enter just by pressing a
> URL to the tests path/to/your/domain/tests/  ..
> All other url's (path/to/your/domain/users/ and path/to/your/domain/
> groups) are still protected by acl + auth but why not my tests.?
>
> Is there something magic about the table posts which cannot be applied
> to other name although the setup is exactly the same?
> Do I have to explicitly set something up in my test-model (ie.   var
> $actsAs = array('Acl' => array('type' => 'controlled'));  or
> parentNode() ) ?
>
> Dont understand this so please help me..
>
> AKO
>
> On Mar 15, 12:00 pm, AKO  wrote:
>
> > So I read the tutorial over and over again and cant figure out why my
> > permissions are not working..
>
> > I followed the tutorial 11.2 and have almost similar structure but
> > instead of 'posts' and 'widgets' i have only 'tests':
>
> >  - superadmin has acces to all controllers
> >  - admin has acces to all controllers/Tests
> >  - user can only view test(results)
>
> > My question is simple: Why can I enter URL tests/index when im not
> > authorized..??
> > Even if I set all my permissions to -1 I still can acces directly via
> > URL entering..??
>
> > Its like the Auth/Acl is only working on my UsersController and not
> > covering my TestsController..
>
> > Any help will be much appreciated..
>
> > INFO:
>
> > ARO's like this:
>
> > [1] superadmin
> >     [5] User.18
> >   [2] admin
> >     [6] User.19
> >   [3] user
> >     [7] User.20
>
> > ACO's look like this:
> > [1] controllers
> >     [2] Pages
> >       [3] display
> >       [4] add
> >       [5] edit
> >       [6] index
> >       [7] view
> >       [8] delete
> >     [9] Users
> >       [10] login
> >       [11] logout
> >       [12] index
> >       [13] view
> >       [14] add
> >       [15] edit
> >       [16] delete
> >       [17] initDB
> >     [18] Tests
> >       [19] index
> >       [20] view
> >       [21] add
> >       [22] edit
> >       [23] delete

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: acl :: deny access to PostsController

2011-03-16 Thread AKO
Im still playing around with this acl-tutorial and followed it with
users,groups,posts,widgets and got it working without problems..

As soon as I shift from from 'posts' to 'tests' the auth and vcl
suddenly doesnt apply by magic and you can enter just by pressing a
URL to the tests path/to/your/domain/tests/  ..
All other url's (path/to/your/domain/users/ and path/to/your/domain/
groups) are still protected by acl + auth but why not my tests.?

Is there something magic about the table posts which cannot be applied
to other name although the setup is exactly the same?
Do I have to explicitly set something up in my test-model (ie.   var
$actsAs = array('Acl' => array('type' => 'controlled'));  or
parentNode() ) ?

Dont understand this so please help me..

AKO

On Mar 15, 12:00 pm, AKO  wrote:
> So I read the tutorial over and over again and cant figure out why my
> permissions are not working..
>
> I followed the tutorial 11.2 and have almost similar structure but
> instead of 'posts' and 'widgets' i have only 'tests':
>
>  - superadmin has acces to all controllers
>  - admin has acces to all controllers/Tests
>  - user can only view test(results)
>
> My question is simple: Why can I enter URL tests/index when im not
> authorized..??
> Even if I set all my permissions to -1 I still can acces directly via
> URL entering..??
>
> Its like the Auth/Acl is only working on my UsersController and not
> covering my TestsController..
>
> Any help will be much appreciated..
>
> INFO:
>
> ARO's like this:
>
> [1] superadmin
>     [5] User.18
>   [2] admin
>     [6] User.19
>   [3] user
>     [7] User.20
>
> ACO's look like this:
> [1] controllers
>     [2] Pages
>       [3] display
>       [4] add
>       [5] edit
>       [6] index
>       [7] view
>       [8] delete
>     [9] Users
>       [10] login
>       [11] logout
>       [12] index
>       [13] view
>       [14] add
>       [15] edit
>       [16] delete
>       [17] initDB
>     [18] Tests
>       [19] index
>       [20] view
>       [21] add
>       [22] edit
>       [23] delete

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL Tutorial SQL statements

2011-02-07 Thread Cyrus
thank you!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL Tutorial SQL statements

2011-02-07 Thread José Lorenzo
This issue was recently fixed, please visit the book page again to see
correct code samples

On Feb 7, 11:32 am, Cyrus  wrote:
> Im not quite sure if I just don't see it, but 
> inhttp://book.cakephp.org/view/1543/Simple-Acl-controlled-Application#!...
> it says " Execute the following SQL statements into your database." where
> there are no SQL statements on the whole page. Could someone tell me where
> to find those?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL How to get logged user information, like user name, id in user table, group name, etc.

2011-01-25 Thread raymond
Yeah. my mistake.
The post I referred also was saying user("id"). :D
Thanks for your kind reply. Raymond.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL How to get logged user information, like user name, id in user table, group name, etc.

2011-01-24 Thread alaxos
If it is not a typo, the reason is that it is not $this->Auth-
>user["id] but $this->Auth->user("id).
user() is a function of the AuthComponent, not a property.

Regards,
nIcO

On Jan 24, 11:49 am, raymond  wrote:
> Hi, everyone.
> I ve entered CakePHP world recently and bumped into one issue.
> I need to get logged users information, especially primary key value
> in user table.
> I have tried $this->Auth->user["id] because I have read it from one
> post in this group, but I checked that $this->Auth does not have any
> user value there.
> So what solution will help me?
> Regards, Raymond.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL how controll more type of action?

2011-01-24 Thread alaxos
Actually you can do exactly what you say with CakePHP ACL. By default,
the AclComponent allow() and deny() methods save 1 and -1 respectively
for all fields _create, _read, _update and _delete. Then if you use
the AclComponent to check if a user is authorized to do some actions,
the check() method simply returns a boolean, used to grant or deny
access.

I have never used the specific values of _create, _read, _update and
_delete, but I guess they are more useful in other situations, but not
to check users permissions on actions. At least in my case, the
aros_acos table contains only records with four 1, or four -1.

Regards,
nIcO

On Jan 24, 1:20 am, Petr Vytlačil  wrote:
> I understand ACL logic and what is ACO etc...
> But I thing this solution is stupid. Why I should setting premissions
> (update,delete,save,add) for action deleteItems of some Controller.
> Its sure I want only check if i can call deleteItems for this i dont
> need check if i has premission for update, delete, etc. for this
> action. .-)
>
> Understand me?
>
> Better solution:
> I has controller Entries and methos deleteEntry, addEntry.
> User role ADMIN has setting permission for ACO: Entries::deleteEntry
> and Entries::addEntry
>
> In app controller i check premission: $this->Acl->check(this->userRole, 
> 'Entries::addEntry');
>
> This is more simple and i dont need controll if users can read, save,
> delete, add this action.
>
> On Jan 12, 9:24 am, Andi  wrote:
>
> > Hi,
>
> > I think that you didn't understand the complex ACL logik. But it is
> > really complex.
>
> > The "actions" update, delete, save, add are the actions for the ACO.
> > So the first question is: what is an ACO? It is an Access Control
> > Object. Read here more about the 
> > logic:http://book.cakephp.org/view/465/Understanding-How-ACL-Works
> > So a typical ACO for CakePHP is a method of a controller.
> > Example:
> > Controller for Usergroups
> > Methods:
> > * add
> > * delete
> > * index
> > * list
> > * mygroups
> > * admin
> > * view
> > Every Method is an ACO and for every ACO you can set the permissions
> > update, delete, save, add.
>
> > More Information about setting the 
> > permissions:http://book.cakephp.org/view/648/Setting-up-permissions
>
> > On 9 Jan., 22:18,PetrVytlaèil  wrote:
>
> > > Hi in ACL you can controll only action (update, delete, save, add) It
> > > is bad because app can has more other metod is any solutuion how
> > > control access for other methor for example:
>
> > > Controller Users
> > > Function list(){
> > >    ..
>
> > > }
>
> > > THX

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL how controll more type of action?

2011-01-23 Thread Petr Vytlačil
I understand ACL logic and what is ACO etc...
But I thing this solution is stupid. Why I should setting premissions
(update,delete,save,add) for action deleteItems of some Controller.
Its sure I want only check if i can call deleteItems for this i dont
need check if i has premission for update, delete, etc. for this
action. .-)

Understand me?

Better solution:
I has controller Entries and methos deleteEntry, addEntry.
User role ADMIN has setting permission for ACO: Entries::deleteEntry
and Entries::addEntry

In app controller i check premission: $this->Acl->check(this-
>userRole, 'Entries::addEntry');
This is more simple and i dont need controll if users can read, save,
delete, add this action.



On Jan 12, 9:24 am, Andi  wrote:
> Hi,
>
> I think that you didn't understand the complex ACL logik. But it is
> really complex.
>
> The "actions" update, delete, save, add are the actions for the ACO.
> So the first question is: what is an ACO? It is an Access Control
> Object. Read here more about the 
> logic:http://book.cakephp.org/view/465/Understanding-How-ACL-Works
> So a typical ACO for CakePHP is a method of a controller.
> Example:
> Controller for Usergroups
> Methods:
> * add
> * delete
> * index
> * list
> * mygroups
> * admin
> * view
> Every Method is an ACO and for every ACO you can set the permissions
> update, delete, save, add.
>
> More Information about setting the 
> permissions:http://book.cakephp.org/view/648/Setting-up-permissions
>
> On 9 Jan., 22:18,PetrVytlaèil  wrote:
>
> > Hi in ACL you can controll only action (update, delete, save, add) It
> > is bad because app can has more other metod is any solutuion how
> > control access for other methor for example:
>
> > Controller Users
> > Function list(){
> >    ..
>
> > }
>
> > THX

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL how controll more type of action?

2011-01-23 Thread Petr Vytlačil
I understand ACL logic and what is ACO etc...
But I thing this solution is stupid. Why I should setting premissions
(update,delete,save,add) for action deleteItems of some Controller.
Its sure I want only check if i can call deleteItems for this i dont
need check if i has premission for update, delete, etc. for this
action. .-)

Understand me?

Better solution:
I has controller Entries and methos deleteEntry, addEntry.
User role ADMIN has setting permission for ACO: Entries::deleteEntry
and Entries::addEntry

In app controller i check premission: $this->Acl->check(this-
>userRole, 'Entries::addEntry');
This is more simple and i dont need controll if users can read, save,
delete, add this action.



On Jan 12, 9:24 am, Andi  wrote:
> Hi,
>
> I think that you didn't understand the complex ACL logik. But it is
> really complex.
>
> The "actions" update, delete, save, add are the actions for the ACO.
> So the first question is: what is an ACO? It is an Access Control
> Object. Read here more about the 
> logic:http://book.cakephp.org/view/465/Understanding-How-ACL-Works
> So a typical ACO for CakePHP is a method of a controller.
> Example:
> Controller for Usergroups
> Methods:
> * add
> * delete
> * index
> * list
> * mygroups
> * admin
> * view
> Every Method is an ACO and for every ACO you can set the permissions
> update, delete, save, add.
>
> More Information about setting the 
> permissions:http://book.cakephp.org/view/648/Setting-up-permissions
>
> On 9 Jan., 22:18,PetrVytlaèil  wrote:
>
> > Hi in ACL you can controll only action (update, delete, save, add) It
> > is bad because app can has more other metod is any solutuion how
> > control access for other methor for example:
>
> > Controller Users
> > Function list(){
> >    ..
>
> > }
>
> > THX

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Acl Tutorial: trying to logout

2011-01-19 Thread opike
I think I fixed this by adding this line to the beforeFilter() method:

$this->Auth->allow('logout');

On Jan 19, 10:10 am, opike  wrote:
> I finished implementing the acl tutorial 
> here:http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
>
> and it was working for the most part, I was testing logging in and out
> with the different users.
>
> But now it's in a state where it won't let me access any of the other
> pages and always redirects me to the top level index.php page with the
> message "You are not authorized to access that location.".
>
> I thought I would be able to run the logout function by issuing this
> url:http://localhost/cake/app/users/logout
> but I get the same "not authorized" message.
>
> When I try to access the login page ("http://localhost/cake/users/
> login") I get the message "You are logged in." without being prompted
> for username and password.
>
> I even tried bouncing apache to reset the session info but that had no
> effect.
>
> How can I get back to where the login page is prompting me for
> username/password again?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: ACL Question

2011-01-18 Thread John Maxim
Hi Ed,

Are you trying to say managing the actions only and sometimes it
affects your CRUD ?

I'm not en expert in this area, but giving my shot is:

Use routing? That area is strange for me.

Are you trying to hide some of the CRUD buttons for some users and not
all?

I think you can do that, I read that somewhere although I didn't
manage to accomplish.

Best wishes, cheers.
John Maxim.

On Jan 18, 12:18 am, CrotchFrog  wrote:
> Hi John,
>
> I do use a plugin to manage permissions and it seems to work quite
> well
> although I still prefer the shell interface for adding/removing aro/
> aco
> and creating permissions on the fly.
>
> The grey area for me right now is authorizing CRUD vs. otherActions.
> I know that I can use Auth->mapActions and treat otherActions as CRUD
> but I assumed that Auth->authorize='actions' would allow me grant/
> deny
> permissions on that action regardless of what the action does in
> relation
> to CRUD.
>
> I guess I'm still a bit confused here.
>
> On Jan 15, 11:02 pm, John Maxim  wrote:
>
> > Hi Ed,
>
> > You can customise your users permission using ACL plugin. I suggest
> > finding one on your own, the current one I use has a drawback when I
> > have over 10 groups with different permission settings. The role
> > permission setting stops working. However, it's still effective if I
> > view users roles or users permission, and from there we can customise
> > the users permission.
>
> > You may want to refer to this:
>
> >http://www.alaxos.net/blaxos/pages/view/7
>
> > I'm not sure if you can find a better one or make one. The recommended
> > ACL plugins can be found here:
>
> > Mark Story's ACL extras and menu components.
>
> >http://josediazgonzalez.com/2010/08/16/cakephp-plugins-a-biblical-ret...
>
> > If anytime you managed to get one working better than any above, share
> > with me.
>
> > :-)
>
> > Best regards,
> > Maxim.
>
> > On Jan 16, 9:59 am, Ed Propsner  wrote:
>
> > > I've been plugging away with Cake for some time now with extremely few
> > > issues. I recently decided that ACL was the right choice for my app ... 
> > > now
> > > I have issues :)
>
> > > I've toyed with it long enough now that I understand the concept and
> > > mechanics of it but the issue I'm having is this:
> > > When granting access, it seems to be all or nothing. If I take the Group
> > > users for example, access has to be at
> > > CRUD 1 1 1 1 or sitewide access is denied. Changing it to CRUD 1 1 1 0
> > > denies access not just to the controller or parts of it,
> > > but the entire app. I was assuming that ultimately I would be able deny
> > > access to any controller/action that I want but it
> > > doesn't seem to be working out that way for me.
>
> > > What I am overlooking here? I referenced the tutorial in the book when
> > > putting the ACL together so the set-up is
> > > very straightforward. I didn't try to do anything fancy or creative with 
> > > it,
> > > it's all by the book.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: ACL Question

2011-01-17 Thread CrotchFrog
Hi John,

I do use a plugin to manage permissions and it seems to work quite
well
although I still prefer the shell interface for adding/removing aro/
aco
and creating permissions on the fly.

The grey area for me right now is authorizing CRUD vs. otherActions.
I know that I can use Auth->mapActions and treat otherActions as CRUD
but I assumed that Auth->authorize='actions' would allow me grant/
deny
permissions on that action regardless of what the action does in
relation
to CRUD.

I guess I'm still a bit confused here.

On Jan 15, 11:02 pm, John Maxim  wrote:
> Hi Ed,
>
> You can customise your users permission using ACL plugin. I suggest
> finding one on your own, the current one I use has a drawback when I
> have over 10 groups with different permission settings. The role
> permission setting stops working. However, it's still effective if I
> view users roles or users permission, and from there we can customise
> the users permission.
>
> You may want to refer to this:
>
> http://www.alaxos.net/blaxos/pages/view/7
>
> I'm not sure if you can find a better one or make one. The recommended
> ACL plugins can be found here:
>
> Mark Story's ACL extras and menu components.
>
> http://josediazgonzalez.com/2010/08/16/cakephp-plugins-a-biblical-ret...
>
> If anytime you managed to get one working better than any above, share
> with me.
>
> :-)
>
> Best regards,
> Maxim.
>
> On Jan 16, 9:59 am, Ed Propsner  wrote:
>
>
>
>
>
>
>
> > I've been plugging away with Cake for some time now with extremely few
> > issues. I recently decided that ACL was the right choice for my app ... now
> > I have issues :)
>
> > I've toyed with it long enough now that I understand the concept and
> > mechanics of it but the issue I'm having is this:
> > When granting access, it seems to be all or nothing. If I take the Group
> > users for example, access has to be at
> > CRUD 1 1 1 1 or sitewide access is denied. Changing it to CRUD 1 1 1 0
> > denies access not just to the controller or parts of it,
> > but the entire app. I was assuming that ultimately I would be able deny
> > access to any controller/action that I want but it
> > doesn't seem to be working out that way for me.
>
> > What I am overlooking here? I referenced the tutorial in the book when
> > putting the ACL together so the set-up is
> > very straightforward. I didn't try to do anything fancy or creative with it,
> > it's all by the book.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: ACL Question

2011-01-15 Thread John Maxim
Hi Ed,

You can customise your users permission using ACL plugin. I suggest
finding one on your own, the current one I use has a drawback when I
have over 10 groups with different permission settings. The role
permission setting stops working. However, it's still effective if I
view users roles or users permission, and from there we can customise
the users permission.

You may want to refer to this:

http://www.alaxos.net/blaxos/pages/view/7

I'm not sure if you can find a better one or make one. The recommended
ACL plugins can be found here:

Mark Story's ACL extras and menu components.

http://josediazgonzalez.com/2010/08/16/cakephp-plugins-a-biblical-retelling/


If anytime you managed to get one working better than any above, share
with me.

:-)

Best regards,
Maxim.


On Jan 16, 9:59 am, Ed Propsner  wrote:
> I've been plugging away with Cake for some time now with extremely few
> issues. I recently decided that ACL was the right choice for my app ... now
> I have issues :)
>
> I've toyed with it long enough now that I understand the concept and
> mechanics of it but the issue I'm having is this:
> When granting access, it seems to be all or nothing. If I take the Group
> users for example, access has to be at
> CRUD 1 1 1 1 or sitewide access is denied. Changing it to CRUD 1 1 1 0
> denies access not just to the controller or parts of it,
> but the entire app. I was assuming that ultimately I would be able deny
> access to any controller/action that I want but it
> doesn't seem to be working out that way for me.
>
> What I am overlooking here? I referenced the tutorial in the book when
> putting the ACL together so the set-up is
> very straightforward. I didn't try to do anything fancy or creative with it,
> it's all by the book.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: ACL for cakephp 1.3

2011-01-14 Thread jsalonen
Hope this helps: http://jsalonen.com/2010/10/role-based-acl-in-cakephp/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: ACL for cakephp 1.3

2011-01-13 Thread Tilen Majerle
http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/1/12 danieln 

> Hi,
>
> anyone came across any tutorials for cakephp 1.3 acl?
>
> I'm very new to cakephp and the most important thing I need to learn
> is to get the auth & acl working together.
>
> Hope someone can advise on this.
>
> If you have done it, I hope you can give me some samples too.
>
> Thanks!
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: ACL how controll more type of action?

2011-01-12 Thread Andi
Hi,

I think that you didn't understand the complex ACL logik. But it is
really complex.

The "actions" update, delete, save, add are the actions for the ACO.
So the first question is: what is an ACO? It is an Access Control
Object. Read here more about the logic:
http://book.cakephp.org/view/465/Understanding-How-ACL-Works
So a typical ACO for CakePHP is a method of a controller.
Example:
Controller for Usergroups
Methods:
* add
* delete
* index
* list
* mygroups
* admin
* view
Every Method is an ACO and for every ACO you can set the permissions
update, delete, save, add.

More Information about setting the permissions:
http://book.cakephp.org/view/648/Setting-up-permissions



On 9 Jan., 22:18, Petr Vytlačil  wrote:
> Hi in ACL you can controll only action (update, delete, save, add) It
> is bad because app can has more other metod is any solutuion how
> control access for other methor for example:
>
> Controller Users
> Function list(){
>    ..
>
> }
>
> THX

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Acl and bindNode()

2011-01-08 Thread Jeremy Burns | Class Outfit
I've been advised to look at the new ACL behaviour as it might hold the key. I 
haven't done so yet, so can't vouch.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 8 Jan 2011, at 10:05, Jens Dittrich wrote:

> So it seems that the documentation is correct regarding the desired
> result but inconsistent in the example. So I have to live with the
> fact that my Users are still added to the Aro table, even though the
> example in the book implies something else.
> 
> Thank you!
> 
> On 7 Jan., 23:30, cricket  wrote:
>> On Fri, Jan 7, 2011 at 7:25 AM, Jens Dittrich  wrote:
>>> Hi all!
>> 
>>> I have a little problem with the Acl. I have Users beloging to Roles.
>>> I want to set my Acl to check the Roles only, since a per User based
>>> system is not planned. So I followed the tutorial from the Book 1.3
>>> (http://book.cakephp.org/view/1547/Acts-As-a-Requester) where it
>>> describes the same situation:
>>> However using bindNode() in the User model does not stop Users from
>>> being inserted into the Acl's aro list, but as far as I understand the
>>> tutorial and especially the given example of "Group-only-Acl" where no
>>> Users are listet in the aro-list.
>> 
>>> Am I doing something wrong or is the given result of the aros just
>>> misleading and the Users will be added anyway but just not being
>>> checked?
>> 
>> You're not alone. See this 
>> thread:http://groups.google.com/group/cake-php/browse_thread/thread/1a758f55...
>> 
>> I don't know if it was ever resolved. Searching "bindNode" in tickets
>> shows these, 
>> though:http://cakephp.lighthouseapp.com/projects/42648/tickets/1343-bindnode...http://cakephp.lighthouseapp.com/projects/42648/tickets/1395-problem-...
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Acl and bindNode()

2011-01-08 Thread Jens Dittrich
So it seems that the documentation is correct regarding the desired
result but inconsistent in the example. So I have to live with the
fact that my Users are still added to the Aro table, even though the
example in the book implies something else.

Thank you!

On 7 Jan., 23:30, cricket  wrote:
> On Fri, Jan 7, 2011 at 7:25 AM, Jens Dittrich  wrote:
> > Hi all!
>
> > I have a little problem with the Acl. I have Users beloging to Roles.
> > I want to set my Acl to check the Roles only, since a per User based
> > system is not planned. So I followed the tutorial from the Book 1.3
> > (http://book.cakephp.org/view/1547/Acts-As-a-Requester) where it
> > describes the same situation:
> > However using bindNode() in the User model does not stop Users from
> > being inserted into the Acl's aro list, but as far as I understand the
> > tutorial and especially the given example of "Group-only-Acl" where no
> > Users are listet in the aro-list.
>
> > Am I doing something wrong or is the given result of the aros just
> > misleading and the Users will be added anyway but just not being
> > checked?
>
> You're not alone. See this 
> thread:http://groups.google.com/group/cake-php/browse_thread/thread/1a758f55...
>
> I don't know if it was ever resolved. Searching "bindNode" in tickets
> shows these, 
> though:http://cakephp.lighthouseapp.com/projects/42648/tickets/1343-bindnode...http://cakephp.lighthouseapp.com/projects/42648/tickets/1395-problem-...

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Acl and bindNode()

2011-01-07 Thread cricket
On Fri, Jan 7, 2011 at 7:25 AM, Jens Dittrich  wrote:
> Hi all!
>
> I have a little problem with the Acl. I have Users beloging to Roles.
> I want to set my Acl to check the Roles only, since a per User based
> system is not planned. So I followed the tutorial from the Book 1.3
> (http://book.cakephp.org/view/1547/Acts-As-a-Requester) where it
> describes the same situation:
> However using bindNode() in the User model does not stop Users from
> being inserted into the Acl's aro list, but as far as I understand the
> tutorial and especially the given example of "Group-only-Acl" where no
> Users are listet in the aro-list.
>
> Am I doing something wrong or is the given result of the aros just
> misleading and the Users will be added anyway but just not being
> checked?

You're not alone. See this thread:
http://groups.google.com/group/cake-php/browse_thread/thread/1a758f5511091d9d/6e83a40c43cbe44c?show_docid=6e83a40c43cbe44c

I don't know if it was ever resolved. Searching "bindNode" in tickets
shows these, though:
http://cakephp.lighthouseapp.com/projects/42648/tickets/1343-bindnode-inconsistency-between-documentation-and-implementation
http://cakephp.lighthouseapp.com/projects/42648/tickets/1395-problem-with-aclnode-node-and-model-bindnode

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Acl

2011-01-05 Thread Jens Dittrich
Thank you for your answer. I already thought that belonging to more
than one groups would break the standard Acl way.

So what about this setup:
User hasOne Person
Person hasOne Role

Can I use bindNode in User to bind it to Person and in Person bindNode
to bind it to Role?

Regards,
Jens

On 5 Jan., 11:53, alaxos  wrote:
> Hi,
>
> AFAIK, the standard permission check done by the pair Auth + Acl only
> works if your users belong to one role only.
> If your users can have many roles, you are not in the standard Acl
> tree structure.
>
> This means that you will have to implement your own authorization
> logic. This may probably be done by setting the AuthComponent::
> $authorize variable to 'controller' and then by implementing the
> Controller::isAuthorized() method in your AppController.
>
> Something like this:
>
> function beforeFilter()
> {
>   $this->Auth->authorize = 'controller'; //-> Auth will use the
> isAuthorized() method
>
> }
>
> function isAuthorized()
> {
>   // Get the logged user
>
>   // Loop on his associated groups
>
>     // For each group call $this->Acl->check($group,
> $current_aco_path)
>
>     // if one call to Acl->check(...) return true, then return true.
>
>   //else return false;
>
> }
>
> I've never done it, but I suppose it should work.
>
> Regards,
> nIcO
>
> On Jan 5, 10:58 am, Jens Dittrich  wrote:
>
>
>
>
>
>
>
> > Hello everyone, I have a problem with Acl. I have an Application where
> > my ACO's are my Controllers and their functions. My ARO's should be
> > Roles that People are in. The setup looks like this:
> > User hasOne Person
> > Person hasAndBelongsToMany Roles
>
> > In the tutorials the setup is simpler, there you have User and Group
> > and you use bindNode() to let ACL look up in the Group. In my
> > situation I want it to look one step further: User over Person to
> > Role. Is that possible?
>
> > Is it supported to belong to multiple ARO's (Roles in my case) by Acl
> > or will I run into Problems?
>
> > Regards,
> > Jens

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Acl

2011-01-05 Thread alaxos
Hi,

AFAIK, the standard permission check done by the pair Auth + Acl only
works if your users belong to one role only.
If your users can have many roles, you are not in the standard Acl
tree structure.

This means that you will have to implement your own authorization
logic. This may probably be done by setting the AuthComponent::
$authorize variable to 'controller' and then by implementing the
Controller::isAuthorized() method in your AppController.

Something like this:

function beforeFilter()
{
  $this->Auth->authorize = 'controller'; //-> Auth will use the
isAuthorized() method
}

function isAuthorized()
{
  // Get the logged user

  // Loop on his associated groups

// For each group call $this->Acl->check($group,
$current_aco_path)

// if one call to Acl->check(...) return true, then return true.


  //else return false;
}

I've never done it, but I suppose it should work.

Regards,
nIcO


On Jan 5, 10:58 am, Jens Dittrich  wrote:
> Hello everyone, I have a problem with Acl. I have an Application where
> my ACO's are my Controllers and their functions. My ARO's should be
> Roles that People are in. The setup looks like this:
> User hasOne Person
> Person hasAndBelongsToMany Roles
>
> In the tutorials the setup is simpler, there you have User and Group
> and you use bindNode() to let ACL look up in the Group. In my
> situation I want it to look one step further: User over Person to
> Role. Is that possible?
>
> Is it supported to belong to multiple ARO's (Roles in my case) by Acl
> or will I run into Problems?
>
> Regards,
> Jens

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Acl and bindNode

2011-01-02 Thread dtemes
using bindNode does not have any effect on the aros table for me
neither (cake 1.3.6) and user registers are still created, but i have
realized that it has an impact in some of the acl lookup queries:

With bindNode:

SELECT `Aro`.`id`, `Aro`.`parent_id`, `Aro`.`model`,
`Aro`.`foreign_key`, `Aro`.`alias` FROM `aros` AS `Aro` LEFT JOIN
`aros` AS `Aro0` ON (`Aro`.`lft` <= `Aro0`.`lft` AND `Aro`.`rght` >=
`Aro0`.`rght`) WHERE `Aro0`.`model` = 'Role' AND `Aro0`.`foreign_key`
= 1 ORDER BY `Aro`.`lft` DESC

SELECT `Aco`.`id`, `Aco`.`parent_id`, `Aco`.`model`,
`Aco`.`foreign_key`, `Aco`.`alias` FROM `acos` AS `Aco` LEFT JOIN
`acos` AS `Aco0` ON (`Aco0`.`alias` = 'controllers') LEFT JOIN `acos`
AS `Aco1` ON (`Aco1`.`lft` > `Aco0`.`lft` AND `Aco1`.`rght` <
`Aco0`.`rght` AND `Aco1`.`alias` = 'Users' AND `Aco0`.`id` =
`Aco1`.`parent_id`) LEFT JOIN `acos` AS `Aco2` ON (`Aco2`.`lft` >
`Aco1`.`lft` AND `Aco2`.`rght` < `Aco1`.`rght` AND `Aco2`.`alias` =
'index' AND `Aco1`.`id` = `Aco2`.`parent_id`) WHERE ((`Aco`.`lft` <=
`Aco0`.`lft` AND `Aco`.`rght` >= `Aco0`.`rght`) OR (`Aco`.`lft` <=
`Aco2`.`lft` AND `Aco`.`rght` >= `Aco2`.`rght`)) ORDER BY `Aco`.`lft`
DESC

Without bindNode:

SELECT `Aro`.`id`, `Aro`.`parent_id`, `Aro`.`model`,
`Aro`.`foreign_key`, `Aro`.`alias` FROM `aros` AS `Aro` LEFT JOIN
`aros` AS `Aro0` ON (`Aro`.`lft` <= `Aro0`.`lft` AND `Aro`.`rght` >=
`Aro0`.`rght`) WHERE `Aro0`.`model` = 'User' AND `Aro0`.`foreign_key`
= 1 ORDER BY `Aro`.`lft` DESC   2   2   0

SELECT `Aco`.`id`, `Aco`.`parent_id`, `Aco`.`model`,
`Aco`.`foreign_key`, `Aco`.`alias` FROM `acos` AS `Aco` LEFT JOIN
`acos` AS `Aco0` ON (`Aco0`.`alias` = 'controllers') LEFT JOIN `acos`
AS `Aco1` ON (`Aco1`.`lft` > `Aco0`.`lft` AND `Aco1`.`rght` <
`Aco0`.`rght` AND `Aco1`.`alias` = 'Users' AND `Aco0`.`id` =
`Aco1`.`parent_id`) LEFT JOIN `acos` AS `Aco2` ON (`Aco2`.`lft` >
`Aco1`.`lft` AND `Aco2`.`rght` < `Aco1`.`rght` AND `Aco2`.`alias` =
'index' AND `Aco1`.`id` = `Aco2`.`parent_id`) WHERE ((`Aco`.`lft` <=
`Aco0`.`lft` AND `Aco`.`rght` >= `Aco0`.`rght`) OR (`Aco`.`lft` <=
`Aco2`.`lft` AND `Aco`.`rght` >= `Aco2`.`rght`)) ORDER BY `Aco`.`lft`
DESC


In the first query using bindNode It's searching on the group (role in
my case) and not the individual user, but the seconf query is still
using the User model... Also I have been unable to find documentation
about the bindNode function in the API docs.

Regards




On 8 dic 2010, 17:32, nachopitt  wrote:
> Hi Soichi. I think the problem seems to be that you are using the Acl
> Component instead of the Acl Behavior. The code will be only executed
> if your User model has the ACL Behavior attached to it. The ACL
> Component has another purporse.
>
> On 7 dic, 14:03, Soichi Hayashi  wrote:
>
> > Hi. I started using CakePHP 3 days ago, and I am using Cake 1.3.6. I
> > am having the same problem reported in this thread.
>
> > I have following in my User model
>
> >         //make ACL group only (http://book.cakephp.org/view/1547/Acts-As-a-
> > Requester)
> >         functionbindNode($user) {
> >             return array('Group' => array('id' => $user['User']
> > ['group_id']));
> >         }
>
> > When I add a new user, it's adding a new User model record in aros
> > table. I've patched db_acl as parallel32 suggests, but it's still
> > adding User model records when I add new users.
>
> > I've also noticed thatbindNode() doesn't seem to be called at all
> > (I've put exit in it, but it doesn't seem to affect the behavior of
> > the app at all). I have following in my app_controller.php
>
> >         var $components = array('Acl');
>
> > Is there something else that I need to do to make group-only
> > authorization work?
>
> > Soichi
>
> > On Nov 27, 8:55 am, parallel32  wrote:
>
> > > A very minor change to the core, but you're right nutesco it would
> > > break upgrades.  So far the fix is holding steady on my deployments so
> > > I'm going to submit it as a bug and perhaps they can permanently fix
> > > it for the next release.
>
> > > If anyone has a userland fix that would be even better in case it
> > > takes a while to fix the core.
>
> > > On Nov 23, 4:38 pm, netusco  wrote:
>
> > > > I just had the same problem, it really looks like a bug on cakephp...
>
> > > > It was working when ids of groups where the same as ids of aros, but
> > > > not working when different.
>
> > > > I agree with parallel 32 but I would prefer not to use his approach as
> > > > it would break in any upgrading...
>
> > > > Is there anyone who could get a light on this issue?
>
> > > > thanks
>
> > > > On Nov 22, 8:37 pm, Jeremy Burns | Class Outfit
>
> > > >  wrote:
> > > > > See the previous reply in this thread that arrived yesterday - 
> > > > > haven't followed it through yet.
>
> > > > > Jeremy Burns
> > > > > Class Outfit
>
> > > > > jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> > > > > On 21 Nov 2010, at 22:49, Rajat wrote:
>
> > > > > > i m also facing this issue.
> > > > > > did u get a

Re: (Acl) Error: aro not found No tree returned.

2010-12-31 Thread John Maxim
Hi thanks, Amit. It still can't be resolved I tried your suggestion.
I'm starting installing acl from fresh. Based on what you said should
work (executing in the webpage)..

Rgds,
Maxim

On Dec 31, 2:42 pm, Amit Badkas  wrote:
> Hi,
>
> Add following code at the end of myAction() method, so that it won't try to
> render the view
>
> $this->render(false);
>
> Also look at the SQL queries if 'aros' table is populating correctly or not
> by setting debug level to 2.
>
> Hope this helps.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Fri, Dec 31, 2010 at 11:52 AM, John Maxim  wrote:
> > I tried executing by going to url: localhost/my_app_name/users/
> > anyAction
>
> > can't load it asks me to check and make sure my file anyaction.ctp is
> > created in views/users
>
> > regards,
> > maxim
>
> > On Dec 31, 12:42 pm, Amit Badkas  wrote:
> > > Hi,
>
> > > I meant that you need to access the method myAction() from URL so that
> > the
> > > code in that method will get executed and according to that code, the
> > dummy
> > > records will get populated to 'aros' table.
>
> > > Amit Badkas
>
> > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > On Fri, Dec 31, 2010 at 9:40 AM, John Maxim  wrote:
> > > > Hi Amit...thanks for the reply but.. I don't understand.
>
> > > > In my Users, there is no file named by anyAction..
>
> > > > anyAction function was saved in /controllers/users_controller.php
>
> > > > What do you mean ?..
>
> > > > best regards,
> > > > Maxim
> > > > On Dec 31, 11:33 am, Amit Badkas  wrote:
> > > > > Hi,
>
> > > > > Have you executed the code in anyAction() to populate ACL tables with
> > > > dummy
> > > > > data, something like http://
> > > > > //users/anyAction?
>
> > > > > Amit Badkas
>
> > > > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > > > On Thu, Dec 30, 2010 at 8:39 PM, John Maxim 
> > wrote:
> > > > > > Hi everyone,
>
> > > > > > While working on the sample provided from cookbook (link below) I
> > was
> > > > > > going to create an aro where the codes are to be placed in a
> > > > > > controller. I chose users_controller.php and I then verify by
> > typing
> > > > > > on my console:
>
> > > > > > cake acl view aro
>
> > > > > > It resulted in
>
> > > > > > Error: aro not found No tree returned.
>
> > > > > > What's wrong with it ?
>
> >http://book.cakephp.org/view/1245/Defining-Permissions-Cake-s-Databas.
> > > > ..
>
> > > > > > Regards,
> > > > > > Maxim
>
> > > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > > > others
> > > > > > with their CakePHP related questions.
>
> > > > > > 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
> > > > > > cake-php+unsubscr...@googlegroups.com
> > 
>
> > > > 
> > 
> > >>For
> > > > more options, visit this group at
> > > > > >http://groups.google.com/group/cake-php?hl=en
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > others
> > > > with their CakePHP related questions.
>
> > > > 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
> > > > cake-php+unsubscr...@googlegroups.com
> > >For
> > more options, visit this group at
> > > >http://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (Acl) Error: aro not found No tree returned.

2010-12-30 Thread Amit Badkas
Hi,

Add following code at the end of myAction() method, so that it won't try to
render the view

$this->render(false);

Also look at the SQL queries if 'aros' table is populating correctly or not
by setting debug level to 2.

Hope this helps.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Fri, Dec 31, 2010 at 11:52 AM, John Maxim  wrote:

> I tried executing by going to url: localhost/my_app_name/users/
> anyAction
>
> can't load it asks me to check and make sure my file anyaction.ctp is
> created in views/users
>
> regards,
> maxim
>
> On Dec 31, 12:42 pm, Amit Badkas  wrote:
> > Hi,
> >
> > I meant that you need to access the method myAction() from URL so that
> the
> > code in that method will get executed and according to that code, the
> dummy
> > records will get populated to 'aros' table.
> >
> > Amit Badkas
> >
> > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> > On Fri, Dec 31, 2010 at 9:40 AM, John Maxim  wrote:
> > > Hi Amit...thanks for the reply but.. I don't understand.
> >
> > > In my Users, there is no file named by anyAction..
> >
> > > anyAction function was saved in /controllers/users_controller.php
> >
> > > What do you mean ?..
> >
> > > best regards,
> > > Maxim
> > > On Dec 31, 11:33 am, Amit Badkas  wrote:
> > > > Hi,
> >
> > > > Have you executed the code in anyAction() to populate ACL tables with
> > > dummy
> > > > data, something like http://
> > > > //users/anyAction?
> >
> > > > Amit Badkas
> >
> > > > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> > > > On Thu, Dec 30, 2010 at 8:39 PM, John Maxim 
> wrote:
> > > > > Hi everyone,
> >
> > > > > While working on the sample provided from cookbook (link below) I
> was
> > > > > going to create an aro where the codes are to be placed in a
> > > > > controller. I chose users_controller.php and I then verify by
> typing
> > > > > on my console:
> >
> > > > > cake acl view aro
> >
> > > > > It resulted in
> >
> > > > > Error: aro not found No tree returned.
> >
> > > > > What's wrong with it ?
> >
> > > > >
> http://book.cakephp.org/view/1245/Defining-Permissions-Cake-s-Databas.
> > > ..
> >
> > > > > Regards,
> > > > > Maxim
> >
> > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > > others
> > > > > with their CakePHP related questions.
> >
> > > > > 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
> > > > > cake-php+unsubscr...@googlegroups.com
> 
> >
> > > 
> 
> >>For
> > > more options, visit this group at
> > > > >http://groups.google.com/group/cake-php?hl=en
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > 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
> > > cake-php+unsubscr...@googlegroups.com
> >For
> more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (Acl) Error: aro not found No tree returned.

2010-12-30 Thread John Maxim
I tried executing by going to url: localhost/my_app_name/users/
anyAction

can't load it asks me to check and make sure my file anyaction.ctp is
created in views/users

regards,
maxim

On Dec 31, 12:42 pm, Amit Badkas  wrote:
> Hi,
>
> I meant that you need to access the method myAction() from URL so that the
> code in that method will get executed and according to that code, the dummy
> records will get populated to 'aros' table.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Fri, Dec 31, 2010 at 9:40 AM, John Maxim  wrote:
> > Hi Amit...thanks for the reply but.. I don't understand.
>
> > In my Users, there is no file named by anyAction..
>
> > anyAction function was saved in /controllers/users_controller.php
>
> > What do you mean ?..
>
> > best regards,
> > Maxim
> > On Dec 31, 11:33 am, Amit Badkas  wrote:
> > > Hi,
>
> > > Have you executed the code in anyAction() to populate ACL tables with
> > dummy
> > > data, something like http://
> > > //users/anyAction?
>
> > > Amit Badkas
>
> > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > On Thu, Dec 30, 2010 at 8:39 PM, John Maxim  wrote:
> > > > Hi everyone,
>
> > > > While working on the sample provided from cookbook (link below) I was
> > > > going to create an aro where the codes are to be placed in a
> > > > controller. I chose users_controller.php and I then verify by typing
> > > > on my console:
>
> > > > cake acl view aro
>
> > > > It resulted in
>
> > > > Error: aro not found No tree returned.
>
> > > > What's wrong with it ?
>
> > > >http://book.cakephp.org/view/1245/Defining-Permissions-Cake-s-Databas.
> > ..
>
> > > > Regards,
> > > > Maxim
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > others
> > > > with their CakePHP related questions.
>
> > > > 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
> > > > cake-php+unsubscr...@googlegroups.com
> > >For
> > more options, visit this group at
> > > >http://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (Acl) Error: aro not found No tree returned.

2010-12-30 Thread Amit Badkas
Hi,

I meant that you need to access the method myAction() from URL so that the
code in that method will get executed and according to that code, the dummy
records will get populated to 'aros' table.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Fri, Dec 31, 2010 at 9:40 AM, John Maxim  wrote:

> Hi Amit...thanks for the reply but.. I don't understand.
>
> In my Users, there is no file named by anyAction..
>
> anyAction function was saved in /controllers/users_controller.php
>
> What do you mean ?..
>
> best regards,
> Maxim
> On Dec 31, 11:33 am, Amit Badkas  wrote:
> > Hi,
> >
> > Have you executed the code in anyAction() to populate ACL tables with
> dummy
> > data, something like http://
> > //users/anyAction?
> >
> > Amit Badkas
> >
> > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> > On Thu, Dec 30, 2010 at 8:39 PM, John Maxim  wrote:
> > > Hi everyone,
> >
> > > While working on the sample provided from cookbook (link below) I was
> > > going to create an aro where the codes are to be placed in a
> > > controller. I chose users_controller.php and I then verify by typing
> > > on my console:
> >
> > > cake acl view aro
> >
> > > It resulted in
> >
> > > Error: aro not found No tree returned.
> >
> > > What's wrong with it ?
> >
> > >http://book.cakephp.org/view/1245/Defining-Permissions-Cake-s-Databas.
> ..
> >
> > > Regards,
> > > Maxim
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > 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
> > > cake-php+unsubscr...@googlegroups.com
> >For
> more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (Acl) Error: aro not found No tree returned.

2010-12-30 Thread John Maxim
Hi Amit...thanks for the reply but.. I don't understand.

In my Users, there is no file named by anyAction..

anyAction function was saved in /controllers/users_controller.php

What do you mean ?..

best regards,
Maxim
On Dec 31, 11:33 am, Amit Badkas  wrote:
> Hi,
>
> Have you executed the code in anyAction() to populate ACL tables with dummy
> data, something like http://
> //users/anyAction?
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Thu, Dec 30, 2010 at 8:39 PM, John Maxim  wrote:
> > Hi everyone,
>
> > While working on the sample provided from cookbook (link below) I was
> > going to create an aro where the codes are to be placed in a
> > controller. I chose users_controller.php and I then verify by typing
> > on my console:
>
> > cake acl view aro
>
> > It resulted in
>
> > Error: aro not found No tree returned.
>
> > What's wrong with it ?
>
> >http://book.cakephp.org/view/1245/Defining-Permissions-Cake-s-Databas...
>
> > Regards,
> > Maxim
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: (Acl) Error: aro not found No tree returned.

2010-12-30 Thread Amit Badkas
Hi,

Have you executed the code in anyAction() to populate ACL tables with dummy
data, something like http://
//users/anyAction?

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Thu, Dec 30, 2010 at 8:39 PM, John Maxim  wrote:

> Hi everyone,
>
> While working on the sample provided from cookbook (link below) I was
> going to create an aro where the codes are to be placed in a
> controller. I chose users_controller.php and I then verify by typing
> on my console:
>
> cake acl view aro
>
> It resulted in
>
> Error: aro not found No tree returned.
>
> What's wrong with it ?
>
> http://book.cakephp.org/view/1245/Defining-Permissions-Cake-s-Database-ACL
>
>
>
> Regards,
> Maxim
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: ACL Aro id problem

2010-12-21 Thread cricket
aros_acos.aro_id is the FK pointing to aros.id, while the FK point to
your Group would be aros.foreign_key.

On Tue, Dec 21, 2010 at 3:06 PM, hcentelles  wrote:
> Hi
>
> The field aro_id in table aros_acos is the id of the aro or the
> foreign key of the aro?.
>
> The allow method of the acl componet creates the rows with the aro id,
> but that dont work, in the groups case, only work if the aro id and
> the foreign key are equals, however if are diferent dont work, but if
> i replace the aro id with the id of the group work perfect.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


  1   2   3   4   5   6   >