FAQ | This is a LIVE service | Changelog

Use DRF permissions properly

Currently the institution permissions check is hard-wired into the view. This should be abstracted out to a custom permission with a has_object_permission() method. See http://www.django-rest-framework.org/api-guide/permissions/#custom-permissions.

This would allow unit testing of permissions as well as simplify the view logic.

We'll need to re-visit permissions at some point anyway once we add lookup institutions to the mix. This way we can compose permissions together via a package such as https://github.com/niwinz/djangorestframework-composed-permissions