You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromjsonrpcserver.methodsimportMethods# During initialization, Methods class receives a list of decoratorsadmin_methods=Methods(decorators=[require_user, require_role('admin')])
# When adding a new method, the function will be wrapped by decorators from the list@admin_methods.add# @require_user# @require_role('admin')defadmin_ping():
return"pong"user_methods=Methods(decorators=[require_user])
@user_methods.add# @require_userdefuser_ping():
return"pong"methods=Methods()
methods.extend(admin_methods)
methods.extend(user_methods)
What do you think of this idea @bcb? I want to implement this
The text was updated successfully, but these errors were encountered:
Just an idea - perhaps some parts of this library, such as the schema validation, could be moved into middleware layers, to give the user more control over which parts are used.
What do you think of this idea @bcb? I want to implement this
The text was updated successfully, but these errors were encountered: