From 0bbe67971fc3b70a6a07cba00180243b8cd6cdbf Mon Sep 17 00:00:00 2001 From: jasquat Date: Mon, 12 Dec 2022 13:19:27 -0500 Subject: [PATCH] updated group api so it is not under tasks --- spiffworkflow-backend/src/spiffworkflow_backend/api.yml | 4 ++-- .../spiffworkflow_backend/config/permissions/development.yml | 5 +++++ .../spiffworkflow_backend/routes/process_api_blueprint.py | 4 ++-- .../src/components/TasksWaitingForMyGroups.tsx | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml index 2836dac2..d6066093 100755 --- a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml +++ b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml @@ -1115,11 +1115,11 @@ paths: items: $ref: "#/components/schemas/Task" - /tasks/user-groups: + /user-groups/for-current-user: get: tags: - Process Instances - operationId: spiffworkflow_backend.routes.process_api_blueprint.task_list_user_groups + operationId: spiffworkflow_backend.routes.process_api_blueprint.user_groups_for_current_user summary: Group identifiers for current logged in user responses: "200": diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/permissions/development.yml b/spiffworkflow-backend/src/spiffworkflow_backend/config/permissions/development.yml index 1f38e02b..737c1a70 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/permissions/development.yml +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/permissions/development.yml @@ -81,6 +81,11 @@ permissions: users: [] allowed_permissions: [read] uri: /v1.0/service-tasks + user-groups-for-current-user: + groups: [everybody] + users: [] + allowed_permissions: [read] + uri: /v1.0/user-groups/for-current-user # read all for everybody diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py index 06c23cf5..19f38934 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -1322,8 +1322,8 @@ def task_list_for_my_groups( ) -def task_list_user_groups() -> flask.wrappers.Response: - """Task_list_user_groups.""" +def user_groups_for_current_user() -> flask.wrappers.Response: + """User_groups_for_current_user.""" groups = g.user.groups # TODO: filter out the default group and have a way to know what is the default group group_identifiers = [i.identifier for i in groups if i.identifier != "everybody"] diff --git a/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx b/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx index 93d21640..99616447 100644 --- a/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx +++ b/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx @@ -7,7 +7,7 @@ export default function TasksWaitingForMyGroups() { useEffect(() => { HttpService.makeCallToBackend({ - path: `/tasks/user-groups`, + path: `/user-groups/for-current-user`, successCallback: setUserGroups, }); }, [setUserGroups]);