Python Eve get AUTH_FIELD value inside an Event Ho

2019-08-29 05:46发布

问题:

I am using User Restricted Resource Access to isolate documents between users.

Is it possible to retrieve the AUTH_FIELD value set during request authentication? I need to filter out only the documents for the current user when doing Pymongo queries in an Event Hook, the same way Eve does.

回答1:

I can't tell if this is the best way, but I found the value inside the flask app under current_app.auth.get_request_auth_value().



标签: python flask eve