Find References to Groups in Kuali Build
Implemented Service
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?
- Application's permissions screen
- groups roles can also be referenced here but that's for a different process
- Forms
- technically groups aren't referenced, blueprints (fka categories) are referenced
- 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
use below sample to view the json in https://hawaii.kualibuild.com/app/api/v0/graphiql
query { app (id:"5e9658e0fad1f3001e4016d3") { name listPolicyGroups { name identities { type label displayName } } workflow } }
- 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
- query
- Outputs
- list of applications referencing the group
- application name
- permissions policy group (null if no references)
- workflow's step name (null if no references)
- list of applications referencing the group
- Inputs