-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
I prefer to think of the parsing as a custom factory
on the route that can setup the request after matching the route. We can then pass the request into a custom factory if the user specified one, and return the context. Imagine:
class AddUser(object):
def __init__(self, request):
pass
def __acl__(self):
return [
(Allow, 'admin', 'create_users'),
]
def jsonrpc_factory(request):
if request.method == 'addUser':
return AddUser(request)
config.add_jsonrpc_endpoint('jsonrpc', '/jsonrpc', factory=jsonrpc_factory)
@jsonrpc_method(endpoint='jsonrpc', permission='create_users')
def addUser(request):
# add a user
Metadata
Metadata
Assignees
Labels
No labels