Re: Problem with the getRights function

Lukas Kahwe Smith <[email protected]> Mon, 21 Nov 2005 09:36:59 +0100
Newsgroups gmane.comp.php.pear.liveuser
Message-ID <[email protected]>
Christoph Pinkl wrote:
> I've the a Problem with the Complex Perm Container.
> I've tried to request the Rights and other information like the area_define_name for one User.
> But as result there was false;
> In the Error Stack stood a wrong SELECT Command is the reason.
> 
> 
> $params = array(
>     'fields' => array(
>         'right_id',
>         'right_define_name',
>         'area_id',
>         'area_define_name'
>     ),
>     'filters' => array(
>         'perm_user_id' => $_REQUEST["user_id"]
>     )
> );
>  
> $user_rights = $LUA->perm->getRights($params);
> 
> var_dump($LUA->getErrors());

Ok this is probably a result of the internal magic we do in order to 
simplify the API. Also we dont have any good documentation on this (once 
I am done with the phpdoc comment fixing the LiveUser_Admin search API 
is the first thing I will write enduser docs on).

Internally LiveUser_Admin does a recursion on all relevant tables for a 
given method (getRights(), getUers()) etc. In theory you could get more 
or less any data with any filtering from any of the methods. In practice 
this does not work as sometimes the recursion will navigate itself into 
a deadend and we have intentionally not implemented any sort of 
backtracking.

In this case it makes sense to try a different method with the same 
parameters. However looking at your query I am kinda suprised why it did 
not work. I will give it a whirle here on my machine and will get back 
to you.

regards,
Lukas