I have the following resource:
class MyUserResource(resources.MongoEngineResource):
class Meta:
...
authentication = MyKeyAuthentication()
authorization = ApiKeyAuthorization()
def override_urls(self):
return [...]
All API calls which are standard-tastypie are routed through the authentification and authorization. But all customized functions/urls (which are in my override_urls) simply ignore the auth/auth functions...
Any ideas why?
Edit:
Maybe the problem is that the dispatcher isn't called. The question remains why that is... and how I can change this behavior!
Ok, finally I found out that when customizing / overriding my urls I also override the standard behavior of calling wrap_view
. This causes the not-calling of dispatch
which is in charge of checking the auth
-methods.
So I just put the auth
-checks manually in evey of my functions (like this):
self.is_authenticated(request)
self.is_authorized(request)
Hope this helps other desperate tastypie-developers :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With