[Gd-hackers] Koala update

Hannes Mehnert hannes at mehnert.org
Thu Feb 7 20:22:28 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA384

Bastian M?üller wrote:
> Hannes Mehnert wrote:
>  > It is quite common that some parts are only accessible after a
>  > successful authentication, that's why I would like to have the
>  > possibility to express this directly in the map. So, my current
>  > proposal for the macro would be:
> 
> I understand what you mean and that's a good feature we should have, but 
>   the suggested "chain"-approach isn't perfect. What happens if an 
> action returns false? The action chain stops and then the user gets a 
> blank page. Maybe replacing the action sequence with normal control flow 
> statements is a better solution,
> 
>> define url-map
>>   "/foo" ("\w/\w/\w") => bind-arguments; "foo.dsp",
>> 	 ("") => "foo.dsp";
>>   "/bar" ("\d/\d/\w") => authenticated-user?; bind-arguments; "bar.dsp";
>>   "/foobar" () => admin-user?; foobar-responder;
>>   "/barfoo" () => "barfoo.dsp";
>> end;
> 
> "/foobar" () => if (admin-user?) foo-bar-responder else 
> not-authenticated-responder end;

Actually, rethinking the authentication, I currently prefer that
admin-user? should signal an error (with not-authenticated-error or
similar) if the current logged in user is not an admin. So, no need for
if then else or to check whether a method returned #f.


Happy hacking,

Hannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHq1p0RcuNlziBjRwRCRcnAKCex9S6auXi4cWhUG2A3nxwcRsXjgCeJGPB
VI4wf4jS09oloiDcOxLZvw8=
=hJAZ
-----END PGP SIGNATURE-----



More information about the hackers mailing list