How to have a global authorization run before all the views without sacrificing the View level permission overrides?
So I wanted to enforce a check before all the APIs and wanted that approach scalable. There are some ways to do these but all have cons,
- Put the check/validation in decorator or mixin . Con - Requires that we put before all the views we need that check for.
- Add a global permission class. Con - View level permission overrides gets sacrificed, if we override then the global permission gets replaced.
Although the check/validation isn't needed in all the APIs but still large number of places we do need it and the validation function itself can filter out those Views that do not need it.