On Tue, Dec 2, 2008 at 3:00 AM, Tóth Imre <[EMAIL PROTECTED]> wrote:
> I did it in a brue force way:), so i am intersted in a smooth solution
> too.:)
>
> 2008/12/1 dr. Hannibal Lecter <[EMAIL PROTECTED]>
>>
>> I'd like to know this too.. I didn't get the time to look into it in
>> detail, but when I do and if I manage to find a solution I'll post it
>> here.
>>
>> On Nov 29, 11:35 am, gk <[EMAIL PROTECTED]> wrote:
>> > Hi there
>> >
>> > I'm trying to work out how to get all the access control objects an
>> > access request object can access - for example all the blog posts a
>> > user can edit. Can anybody point me in the right direction on how to
>> > do this? Thanks very much.


I used this myself, I don't think it's perfect, but suits my needs for now:


        $this->Aco = ClassRegistry::init('Aco');

        $this->Aco->bindModel(array(
            'hasOne' => array(
                'ArosAco',
                'FilterAro' => array(
                    'className' => 'Aro',
                    'foreignKey' => false,
                    'conditions' => array(
                        'FilterAro.id = ArosAco.aro_id',
                    )
                )
            )
        ));

        $selected = $this->Aco->find('all', array(
            'recursive' => 0,
            'fields' => array('Aco.id','Aco.alias'),
            'conditions' => array(
                'FilterAro.model' => $this->model,
                'FilterAro.foreign_key' => $this->id
            )
        ));

        $this->acos = array();
        foreach ($selected as $aco) $this->acos[ $aco['Aco']['id'] ] =
$aco['Aco']['alias'];


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to