How can I pass a detail object to custom authorization in tastypie?
问题 How can I access the detail endpoint object being accessed in the request during a tastypie authorization? I noticed that one of the overridden methods in the docs has an object parameter -- how can I set this? 回答1: In branch perms, https://github.com/toastdriven/django-tastypie/blob/perms/tastypie/authorization.py Class Authorization has a set of methods for example: def read_detail(self, object_list, bundle): """ Returns either ``True`` if the user is allowed to read the object in question