Library to check user roles in AnyLogic models.
High-level flow:
- User is logged in via OIDC
- AnyLogic model is started from a web page
- OIDC ID token is set as a model input parameter
- Lux Access library is used to check the user role in order to display or hide GUI elements
Download jarfile from https://github.com/Zenmo/lux-access/releases and add to dependencies.
Then use the hasRole function to check if the user has a specific role.
import static energy.lux.access.LuxAccessKt.hasRole;
if (hasRole("admin", idToken)) {
// show GUI element
}
How to easily obtain an ID token to run a model locally?
(TODO)
./gradlew shadowJar