Automating Group Assignments
Overview
Mend does not have a built in method of automating the assignment of Groups to Roles. This process needs to be scripted out utilizing the Mend API. The goal of this document is provide guidance on the APIs needed to perform Group to Role mapping.
API Calls
Prior to scripting out the API process below a method to identify the groups that need to have a role assigned to them and the products they are to be assigned to needs to be determined and incorporated into the steps below.
Login and save Bearer Token
This token needs to be provided to authenticate to all subsequent requests
Get the UUID of all Groups in the Organization
Save the UUID of the desired group
Pull the Projects and Products of the Organization
Loop through all products and save the UUID of the desired products
For each identified product, add the Group to the product as the desired role
Optional Calls
Assigning Users to Groups
If you are integrated into Mend using the SAML integration, this step is performed by the SAML integration the first time the user logs in. For more information see the SAML Access Control Setup Guide.
Get All Users for the Organization
Save the Email of the Desired Users
Get the UUID of all Groups in the Organization
Save the UUID of the desired group
Add Users to the Desired Group