@require_api_auth()<EOL><INDENT>@require_oauth_scopes(write_scope.id)<EOL>@pass_record<EOL>@need_record_permission('<STR_LIT>')<EOL>def delete(self, pid, record, key):<DEDENT>
try:<EOL><INDENT>del record.files[str(key)]<EOL>record.commit()<EOL>db.session.commit()<EOL>return make_response('<STR_LIT>', <NUM_LIT>)<EOL><DEDENT>except KeyError:<EOL><INDENT>abort(<NUM_LIT>, '<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>
Handle DELETE deposit file.

        Permission required: `update_permission_factory`.

        :param pid: Pid object (from url).
        :param record: Record object resolved from the pid.
        :param key: Unique identifier for the file in the deposit.