semvec/pypi-packages huggingface dataset:
lribeiro.cherrypy.authorizer.mongoengine 1.0.1
Basic user model, authenticator and authorizer for lribeiro.cherrypy.authorizer and mongoengine
License: BSD License
Keywords: authentication,authorization,access control,cherrypy,mongoengine

===============================
cherrypy.authorizer.mongoengine
===============================

Basic user model, authenticator and authorizer for lribeiro.cherrypy.authorizer and mongoengine

Usage:
------

.. sourcecode:: python

    import cherrypy

    from lribeiro.cherrypy.authorizer import authorize
    from lribeiro.cherrypy.authorizer.authentication import AuthControllerDefaultDispatcher

    from lribeiro.cherrypy.authorizer.mongoengine.auth import authenticator, authorizer


    class Root:
        @cherrypy.expose
        def index(self):
            return 'index'

        @cherrypy.expose
        @authorize
        def auth_required(self):
            return 'auth required'

        @cherrypy.expose
        @authorize({'read': 'page', 'write': 'log'})
        def authorized(self):
            return 'authorized'

        @cherrypy.expose
        @authorize({'edit': ['page', 'site']})
        def unauthorized(self):
            return 'unauthorized'

    config = {
        '/': {
            'tools.sessions.on': True,
            'tools.authorizer.on': True,
            'auth.authenticator': authenticator,
            'auth.authorizer': authorizer,
            'auth.login_page': '/login'
        }
    }

    if __name__ == '__main__':
        root = Root()
        root.auth = AuthControllerDefaultDispatcher()

        cherrypy.quickstart(root, '/', config)
lribeiro.cherrypy.authorizer.neomodel 1.0.1
Basic user model, authenticator and authorizer for lribeiro.cherrypy.authorizer and neomodel
License: BSD License
Keywords: authentication,authorization,access control,cherrypy,neomodel

===============================
cherrypy.authorizer.neomodel
===============================

Basic user model, authenticator and authorizer for lribeiro.cherrypy.authorizer and neomodel

Usage:
------

.. sourcecode:: python

    import cherrypy

    from lribeiro.cherrypy.authorizer import authorize
    from lribeiro.cherrypy.authorizer.authentication import AuthControllerDefaultDispatcher

    from lribeiro.cherrypy.authorizer.neomodel.auth import authenticator, authorizer


    class Root:
        @cherrypy.expose
        def index(self):
            return 'index'

        @cherrypy.expose
        @authorize
        def auth_required(self):
            return 'auth required'

        @cherrypy.expose
        @authorize({'read': 'page', 'write': 'log'})
        def authorized(self):
            return 'authorized'

        @cherrypy.expose
        @authorize({'edit': ['page', 'site']})
        def unauthorized(self):
            return 'unauthorized'

    config = {
        '/': {
            'tools.sessions.on': True,
            'tools.authorizer.on': True,
            'auth.authenticator': authenticator,
            'auth.authorizer': authorizer,
            'auth.login_page': '/login'
        }
    }

    if __name__ == '__main__':
        root = Root()
        root.auth = AuthControllerDefaultDispatcher()

        cherrypy.quickstart(root, '/', config)