Find References to Groups in Kuali Build

Implemented Service

https://docprod.pvt.hawaii.edu/kuali-build-services/api-docs/?urls.primaryName=kuali-build-utils#/Users%20and%20Groups/get_group__groupName__references

Background

Kuali groups cleanup needs to be done however, it's impossible to know if a group is being referenced. There's a graphql query that attempts to do this but it's not efficient, thus we need to do this programmatically. 

Where can groups be referenced?

  1. Application's permissions screen
    1. groups roles can also be referenced here but that's for a different process
  2. Forms
    1. technically groups aren't referenced, blueprints (fka categories) are referenced
  3. Workflow

What

  • Create a program to execute the query below, which includes the form fields, policy groups (aka application permissions), and the workflow steps
    • Inputs
      • groupName
    • Logic
      • lookup the groupId based on the groupName
      • lookup all the application ids in the system
      • loop through each application id
        • query 
        • search for the groupName in the response
          • matches will come against the listPolicyGroups ojbect under identities where type=GROUP and label=groupName
          • matches will come against the assignee.value.group.label object; part of the group object is the group id 
    • Outputs
      • list of applications referencing the group
        • application name
        • permissions policy group (null if no references)
        • workflow's step name (null if no references)