Re: checkRight() patch

Lukas Kahwe Smith <[email protected]> Fri, 26 Aug 2005 16:46:37 +0200
Newsgroups gmane.comp.php.pear.liveuser
Message-ID <[email protected]>
Helgi Þormar wrote:

> I fail to see how that will benefit us, if you'd explain it a little
> then I might change my mind.

The basic ideas is that passing a right id with:

null => LIVEUSER_MAX_LEVEL
0 => LIVEUSER_MAX_LEVEL when logged in
anything else => check in the perm container

notice that the perm container already also returns LIVEUSER_MAX_LEVEL 
when a right_id of 0 is passed.

the goal here is to help frameworks to disable rights checking or to 
limit the rights checking to logged in users. however since its not 
required to map auth users to perm users, this additional else was 
necessary.

for example in the webbuilder2 framework i recently added captcha 
support, so that anonymous users can login. its not really partical to 
map these users to perm users usually.

regards,
Lukas