@frontend.route('/objects/<int:object_id>/files/<int:file_id>/hide', methods=['POST'])
@object_permissions_required(Permissions.WRITE)
def hide_file(object_id, file_id):
    check_current_user_is_not_readonly()
    form = FileHidingForm()
    if (not form.validate_on_submit()):
        return flask.abort(400)
    reason = form.reason.data
    try:
        logic.files.hide_file(object_id=object_id, file_id=file_id, user_id=flask_login.current_user.id, reason=reason)
    except logic.errors.FileDoesNotExistError:
        return flask.abort(404)
    flask.flash(_('The file was hidden successfully.'), 'success')
    return flask.redirect(flask.url_for('.object', object_id=object_id, _anchor='file-{}'.format(file_id)))
@frontend.route('/objects/<int:object_id>/files/<int:file_id>/hide', methods=['POST'])
@object_permissions_required(Permissions.WRITE)
def hide_file(object_id, file_id):
    check_current_user_is_not_readonly()
    form = FileHidingForm()
    if (not form.validate_on_submit()):
        return flask.abort(400)
    reason = form.reason.data
    try:
        logic.files.hide_file(object_id=object_id, file_id=file_id, user_id=flask_login.current_user.id, reason=reason)
    except logic.errors.FileDoesNotExistError:
        return flask.abort(404)
    flask.flash(_('The file was hidden successfully.'), 'success')
    return flask.redirect(flask.url_for('.object', object_id=object_id, _anchor='file-{}'.format(file_id)))