diff options
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/static/new/css/show_trait.css | 2 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 37 |
2 files changed, 16 insertions, 23 deletions
diff --git a/wqflask/wqflask/static/new/css/show_trait.css b/wqflask/wqflask/static/new/css/show_trait.css index d3e6672a..338302af 100644 --- a/wqflask/wqflask/static/new/css/show_trait.css +++ b/wqflask/wqflask/static/new/css/show_trait.css @@ -36,7 +36,7 @@ table.dataTable thead th, table.dataTable tfoot { } table.dataTable tbody td { - padding: 4px 20px 2px 10px; + padding: 4px 15px 2px 10px; } table.dataTable.cell-border tbody th, table.dataTable.cell-border tbody td { diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 57183eed..dde22bf7 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -61,7 +61,7 @@ from utility.authentication_tools import check_resource_availability from utility.redis_tools import get_redis_conn Redis = get_redis_conn() -from base.webqtlConfig import GENERATED_IMAGE_DIR +from base.webqtlConfig import GENERATED_IMAGE_DIR, DEFAULT_PRIVILEGES from utility.benchmark import Bench from pprint import pformat as pf @@ -91,27 +91,20 @@ def connect_db(): def check_access_permissions(): logger.debug("@app.before_request check_access_permissions") available = True - if "temp_trait" in request.args: - if request.args['temp_trait'] == "True": - pass - else: - if 'dataset' in request.args: - if request.args['dataset'] == "Temp": - permissions = check_resource_availability("Temp") - else: - dataset = create_dataset(request.args['dataset']) - - if dataset.type == "Temp": - permissions = False - if 'trait_id' in request.args: - permissions = check_resource_availability(dataset, request.args['trait_id']) - elif dataset.type != "Publish": - permissions = check_resource_availability(dataset) - else: - return None - - if 'view' not in permissions['data']: - return redirect(url_for("no_access_page")) + if 'dataset' in request.args: + permissions = DEFAULT_PRIVILEGES + if request.args['dataset'] != "Temp": + dataset = create_dataset(request.args['dataset']) + + if dataset.type == "Temp": + permissions = DEFAULT_PRIVILEGES + elif 'trait_id' in request.args: + permissions = check_resource_availability(dataset, request.args['trait_id']) + elif dataset.type != "Publish": + permissions = check_resource_availability(dataset) + + if 'view' not in permissions['data']: + return redirect(url_for("no_access_page")) @app.teardown_appcontext def shutdown_session(exception=None): |