durusmail: quixote-users: quixote 2.4 and _q_access
quixote 2.4 and _q_access
2008-04-22
2008-04-22
2008-04-22
2008-04-22
2008-04-22
2008-04-23
quixote 2.4 and _q_access
alexander krohn
2008-04-22
Titus Brown schrieb:
> [...]
>
> Hi, Alexander, can you give us a short example that doesn't work?
>
> cheers,
> --titus
>
>
i think it's a problem about the traversal.

anyway, here you go:

import quixote
from quixote.publish import Publisher
from quixote.server.simple_server import run
from quixote.directory import Directory, AccessControlled
from quixote.errors import AccessError

class RootDirectory(Directory, AccessControlled):
    _q_exports = ['', ]
    def _q_index(self):
        return "moin"

    def _q_access():
        raise AccessError()

def create_publisher():
    return Publisher(RootDirectory())

if __name__ == '__main__':
    run(create_publisher, host = 'localhost', port = 9999)

reply