Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/instance/app.cfg.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ GLOBUS_CLIENT_APP_URI = 'https://data.dev.sennetconsortium.org/'
DATA_INGEST_BOARD_APP_URI = 'http://localhost:3001/'
DATA_INGEST_BOARD_NAME = ‘Data Ingest Board - DEV’

SENOTYPE_SEARCH_URI = 'http://localhost:3002/'
SENOTYPE_SEARCH_NAME = 'SenNet Senotype Search - DEV'
SENOTYPE_LIBRARY_URI = 'https://senlib.dev.sennetconsortium.org/'
SENOTYPE_LIBRARY_NAME = 'SenNet Senotype Library - DEV'
SENOTYPE_GROUP_UUID = 'c43c14da-0b51-11f1-a6c4-0e71192eda6f'

#Sets the domain for the cookie set upon login to the portal. Use `localhost` for local development
COOKIE_DOMAIN = '.sennetconsortium.org'
Expand Down
2 changes: 1 addition & 1 deletion src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ requests==2.33.0
# Use the branch name of commons from github for testing new changes made in commons from different branch
# Default is main branch specified in docker-compose.development.yml if not set
# git+https://github.com/hubmapconsortium/commons.git@${COMMONS_BRANCH}#egg=hubmap-commons
hubmap-commons==2.1.23
hubmap-commons==2.1.24
atlas-consortia-commons==1.1.5

# For assay type rules
Expand Down
20 changes: 10 additions & 10 deletions src/routes/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def data_ingest_login():
redirect_failure_uri="/data-ingest-board-logout",
)

@auth_blueprint.route("/senotype-search-login")
def senotype_search_login():
@auth_blueprint.route("/senotype-library-login")
def senotype_library_login():
return _login(
redirect_uri=current_app.config["SENOTYPE_SEARCH_URI"],
key="senotype_search_tokens",
redirect_failure_uri="/senotype-serach-logout",
redirect_uri=current_app.config["SENOTYPE_LIBRARY_URI"],
key="senotype_library_tokens",
redirect_failure_uri="/senotype-library-logout",
)

@auth_blueprint.route("/logout")
Expand All @@ -63,14 +63,14 @@ def logout():
def data_ingest_logout():
return _logout(
redirect_uri=current_app.config["DATA_INGEST_BOARD_APP_URI"],
app_name=current_app.config["SENOTYPE_SEARCH_NAME"],
key="senotype_search_tokens",
app_name=current_app.config["SENOTYPE_LIBRARY_NAME"],
key="senotype_library_tokens",
)

@auth_blueprint.route("/senotype-search-logout")
def senotype_search_logout():
@auth_blueprint.route("/senotype-library-logout")
def senotype_library_logout():
return _logout(
redirect_uri=current_app.config["SENOTYPE_SEARCH_URI"],
redirect_uri=current_app.config["SENOTYPE_LIBRARY_URI"],
app_name=current_app.config["DATA_INGEST_BOARD_NAME"],
key="ingest_board_tokens",
)
Expand Down
2 changes: 1 addition & 1 deletion src/routes/metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def get_all_data_provider_groups(token: str, user: User):
def get_provenance_metadata(ds_uuid: str):
try:
token = get_token()
entity = get_entity(entity_id=ds_uuid, token=token)
entity = get_entity(entity_id=ds_uuid, token=None)

e = Ontology.ops().entities()
allowed_entity_types = [e.DATASET, "Publication"]
Expand Down
20 changes: 19 additions & 1 deletion src/routes/privs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from typing import List

from flask import Blueprint, Response, jsonify, make_response, request
from flask import Blueprint, Response, jsonify, make_response, request, current_app
from hubmap_commons.exceptions import HTTPException
from hubmap_commons.hm_auth import AuthHelper

Expand Down Expand Up @@ -55,6 +55,24 @@ def privs_get_user_write_groups():
return make_response(jsonify({"user_write_groups": user_write_groups}), 200, headers)


@privs_blueprint.route("/privs/has-senotype-edit")
def privs_has_senotype_edit():
groups_token: str = get_groups_token()
auth_helper_instance: AuthHelper = AuthHelper.instance()
has_senotype_edit = False

user_info = auth_helper_instance.getUserInfo(groups_token, getGroups=True)
if isinstance(user_info, Response):
return user_info

if current_app.config["SENOTYPE_GROUP_UUID"] in user_info['hmgroupids']:
has_senotype_edit = True

headers: dict = {"Content-Type": "application/json"}
return make_response(jsonify({"has_senotype_edit": has_senotype_edit}), 200, headers)



@privs_blueprint.route("/privs/has-data-admin")
def privs_has_data_admin_privs():
groups_token: str = get_groups_token()
Expand Down
Loading