@@ -0,0 +1,846 @@
+from oauth2_provider.ext.rest_framework import TokenHasScope%0Afrom rest_framework.permissions import DjangoObjectPermissions%0A%0A%0Aclass TokenHasScopeOrUserHasObjectPermissionsOrWriteOnly(DjangoObjectPermissions, TokenHasScope):%0A    %22%22%22%0A    Allow anyone to write to this endpoint, but only the ones with the required scope to read.%0A    %22%22%22%0A%0A    perms_map = %7B%0A        'GET': %5B'%25(app_label)s.view_%25(model_name)s'%5D,%0A        'OPTIONS': %5B%5D,%0A        'HEAD': %5B%5D,%0A        'POST': %5B'%25(app_label)s.add_%25(model_name)s'%5D,%0A        'PUT': %5B'%25(app_label)s.change_%25(model_name)s'%5D,%0A        'PATCH': %5B'%25(app_label)s.change_%25(model_name)s'%5D,%0A        'DELETE': %5B'%25(app_label)s.delete_%25(model_name)s'%5D,%0A    %7D%0A%0A    def has_permission(self, request, view):%0A%0A        if request.method == 'POST':%0A            return True%0A%0A        return super().has_permission(request, view)%0A

Add API permission class for HasScopeOrWriteOnly