From ec728e6f50682dd6bfb23245e9b5877e92440294 Mon Sep 17 00:00:00 2001 From: Bryan Larson Date: Tue, 3 Nov 2020 13:02:07 -0500 Subject: [PATCH] fix(auth): Fixed Auth method for checking study permissions --- ppmutils/auth.py | 8 ++++---- ppmutils/ppm.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ppmutils/auth.py b/ppmutils/auth.py index b07dca1..581d1a4 100644 --- a/ppmutils/auth.py +++ b/ppmutils/auth.py @@ -121,24 +121,24 @@ def has_ppm_permission(cls, permissions, method=None): return item is not None and permission is not None @classmethod - def has_study_permission(cls, method, permissions, study): + def has_study_permission(cls, permissions, study, method=None): """ Inspects the set of permissions and returns whether this user has needed permissions on the particular PPM study for the given operation. - :param method: The requested method to check permissions for - :type method: str :param permissions: A list of permissions from DBMI-AuthZ :type permissions: list :param study: A specific study :type study: str + :param method: The requested method to check permissions for + :type method: str, default None :returns: Whether the user has the permissions or not :rtype: bool """ # Get permission - item, permission = Auth.get_permission(method, permissions, study) + item, permission = Auth.get_permission(permissions, method=method, study=study) return item is not None and permission is not None diff --git a/ppmutils/ppm.py b/ppmutils/ppm.py index a38d713..0b1eae9 100644 --- a/ppmutils/ppm.py +++ b/ppmutils/ppm.py @@ -829,7 +829,7 @@ def questionnaire_for_study(study): return PPM.Questionnaire.RANTQuestionnaire.value elif PPM.Study.get(study) is PPM.Study.EXAMPLE: - return PPM.Questionnaire.ExampleQuestionnaire.value + return PPM.Questionnaire.EXAMPLEQuestionnaire.value @staticmethod def questionnaire_for_consent(composition):