def delete(self, request, *args, **kwargs):

        document = self.get_object().document

        if document.checkout_info().user == request.user:
            try:
                Permission.check_permissions(
                    request.user, (permission_document_checkin,)
                )
            except PermissionDenied:
                AccessControlList.objects.check_access(
                    permission_document_checkin, request.user, document
                )
        else:
            try:
                Permission.check_permissions(
                    request.user, (permission_document_checkin_override,)
                )
            except PermissionDenied:
                AccessControlList.objects.check_access(
                    permission_document_checkin_override, request.user,
                    document
                )

        return super(
            APICheckedoutDocumentView, self
        ).delete(request, *args, **kwargs)
Adds a row to the end of the :class:`Dataset`.
dataset/ETHPy150Open mayan-edms/mayan-edms/mayan/apps/checkouts/api_views.py/APICheckedoutDocumentView.delete--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/tablib-0.10.0/tablib/core.py/Dataset.rpush