Re: Cake 2.1 Problem creating Aro records from existent users

2012-08-27 Thread kani
Yes me too

On Tuesday, April 3, 2012 8:44:46 AM UTC+8, Arnold wrote:

 Hi,

 I'm trying to implement ACL for my already created application and
 need to create the aro records for my current existent users. On IRC
 Ceeram said i just need to load AclBehaviour into my User's model,
 find all users and save it (update any field, i guess) and that will
 create the ARO row. I triedy but it doesn't works, it return me an
 error:

 AclNode::node() - Couldn#039;t find Aro node identified by
 quot;Array ( [Aro0.model] =gt; User [Aro0.foreign_key] =gt; 1 )
 quot;

 this is my current code:

 / User actsAs... acl = requester

 //user model:
 // i don't want to have a groups table. i have rol field as ENUM in my
 user table for group
 public function parentNode() {
 if (!$this-id  empty($this-data)) {
 return null;
 }
 if (isset($this-data['User']['rol'])) {
 $groupId = $this-data['User']['rol'];
 } else {
 $groupId = $this-field('rol');
 }

 if (!$groupId) {
 return null;
 } else {
 return $groupId;
 }
 }

 //user controller
 function init_acl_db(){
 $this-User-recursive = -1;
 $users = $this-User-find('all');
 foreach ($users as $u) {
 $this-User-create();
 $this-User-id = $u['User']['id'];
 $this-User-saveField('modified', date('Y-m-d 
 h:i:s'));
 // this returns me this error: AclNode::node() - Couldn#039;t find
 Aro node identified by quot;Array ( [Aro0.model] =gt; User
 [Aro0.foreign_key] =gt; 1 ) quot;



-- 
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-US.




Cake 2.1 Problem creating Aro records from existent users

2012-04-02 Thread Arnold Roa
Hi,

I'm trying to implement ACL for my already created application and
need to create the aro records for my current existent users. On IRC
Ceeram said i just need to load AclBehaviour into my User's model,
find all users and save it (update any field, i guess) and that will
create the ARO row. I triedy but it doesn't works, it return me an
error:

AclNode::node() - Couldn#039;t find Aro node identified by
quot;Array ( [Aro0.model] =gt; User [Aro0.foreign_key] =gt; 1 )
quot;

this is my current code:

/ User actsAs... acl = requester

//user model:
// i don't want to have a groups table. i have rol field as ENUM in my
user table for group
public function parentNode() {
if (!$this-id  empty($this-data)) {
return null;
}
if (isset($this-data['User']['rol'])) {
$groupId = $this-data['User']['rol'];
} else {
$groupId = $this-field('rol');
}

if (!$groupId) {
return null;
} else {
return $groupId;
}
}

//user controller
function init_acl_db(){
$this-User-recursive = -1;
$users = $this-User-find('all');
foreach ($users as $u) {
$this-User-create();
$this-User-id = $u['User']['id'];
$this-User-saveField('modified', date('Y-m-d h:i:s'));
// this returns me this error: AclNode::node() - Couldn#039;t find
Aro node identified by quot;Array ( [Aro0.model] =gt; User
[Aro0.foreign_key] =gt; 1 ) quot;

-- 
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