TastyPie - Override_urls ignores authentication and authorization

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 tastipies, are routed through authentication and authorization. But all configured functions / urls (which are in my override_urls) just ignore auth / auth functions ...

Any ideas why?

Edit:

Maybe the problem is that the dispatcher is not being called. The question remains, why is this ... and how can I change this behavior!

+7
source share
1 answer

Well, it finally turned out that when setting up / redefining my URLs, I also override the standard wrap_view call wrap_view . This causes a non-call dispatch , which is responsible for checking auth methods.

So, I just put auth -checks manually in the evey of my functions (like this):

 self.is_authenticated(request) self.is_authorized(request) 

Hope this helps other desperate tastypie developers :)

+15
source

All Articles