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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.