From 28f67d85416c48c2196dff889bfab8e9659aa5b6 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 28 Oct 2021 12:53:26 +0300 Subject: Add "login_required" decorator to metadata edit endpoints --- wqflask/wqflask/metadata_edits.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'wqflask') diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py index d232b32b..fad9c315 100644 --- a/wqflask/wqflask/metadata_edits.py +++ b/wqflask/wqflask/metadata_edits.py @@ -11,6 +11,7 @@ from flask import (Blueprint, current_app, redirect, from itertools import groupby from wqflask.decorators import edit_access_required +from wqflask.decorators import login_required from gn3.db import diff_from_dict from gn3.db import fetchall @@ -118,6 +119,7 @@ def edit_probeset(conn, name): @metadata_edit.route("//traits/") @edit_access_required +@login_required def display_phenotype_metadata(dataset_id: str, name: str): conn = MySQLdb.Connect(db=current_app.config.get("DB_NAME"), user=current_app.config.get("DB_USER"), @@ -138,6 +140,7 @@ def display_phenotype_metadata(dataset_id: str, name: str): @metadata_edit.route("/traits/") @edit_access_required +@login_required def display_probeset_metadata(name: str): conn = MySQLdb.Connect(db=current_app.config.get("DB_NAME"), user=current_app.config.get("DB_USER"), @@ -156,6 +159,7 @@ def display_probeset_metadata(name: str): @metadata_edit.route("//traits/", methods=("POST",)) @edit_access_required +@login_required def update_phenotype(dataset_id: str, name: str): conn = MySQLdb.Connect(db=current_app.config.get("DB_NAME"), user=current_app.config.get("DB_USER"), @@ -283,6 +287,7 @@ def update_phenotype(dataset_id: str, name: str): @metadata_edit.route("/traits/", methods=("POST",)) @edit_access_required +@login_required def update_probeset(name: str): conn = MySQLdb.Connect(db=current_app.config.get("DB_NAME"), user=current_app.config.get("DB_USER"), -- cgit v1.2.3