Export User Role Mappings
After an application is shared or deployed, any changes you make to user roles in that scope are updated directly in the application's IDCS environment. These updates are no longer copied to your application's user-roles.json
file. If you want the role mappings in IDCS saved to your application's sources, you'll need to export the information from IDCS to your user-roles.json
file.
When you first create user roles and map those roles to IDCS groups, the role mappings are stored in the application's sources, as part of the user-roles.json
file. These initial role mappings (defined as the application's defaultMapping
in user-roles.json
) are automatically propagated to IDCS when you first share or deploy your application. After the application is shared or deployed (usually, with a version in the URL), any changes you make to your role mappings go directly to IDCS. As a result, the user-roles.json
file in your application's sources won't be in sync with your changes in IDCS.
Does this matter? Yes, because the role-mapping information in user-roles.json
is used as the source for many operations, for example, when a teammate clones your Git repository to create a new workspace. Because user-roles.json
doesn't have the latest IDCS changes, the file versioned in Git also doesn't have these updates. Consequently, the new workspace that is cloned from Git won't have the most up-to-date role mappings.
Stale information can also affect role mappings when you deploy your app to a different URL after changing its root URL in Settings—but deployments to the same URL, both with or without a version, won't be impacted. In other words, the defaultMapping
in user-roles.json
is used only when an app is shared or deployed for the first time or when it is deployed afresh to a different URL.
Any time you change an application's role mapping after the app is shared or deployed, you can export the role mapping from IDCS and refresh the defaultMapping
in user-roles.json
. You can do this at the level of your application's three scopes: when it is shared from your workspace, when it is deployed with a version in its URL, and when it is deployed live to production.
Once you refresh the source file and push the updated file to Git, all new deployments will include the updated role-mapping information from IDCS. So will any new workspaces created from branches with the refreshed role mappings.
To export role mappings from IDCS to your source file: