yuqi1129 opened a new pull request, #10930: URL: https://github.com/apache/gravitino/pull/10930
### What changes were proposed in this pull request? This PR backports the optimization from #10908 to `1.2.0-hotfix`. The backport includes: - caching the current request's user role IDs in `AuthorizationRequestContext` - building and using a per-role policy index in `JcasbinAuthorizer` - keeping user-role assignment changes immediately visible during authorization - backporting the related regression tests ### Why are the changes needed? The previous JCasbin authorization path relied on `enforce` for each privilege probe and could still observe stale user-role links cached in the enforcer. This backport keeps the hotfix branch aligned with the optimized authorization path from branch-1.2, reduces the lookup cost on the authorization hot path, and makes role assignment changes take effect immediately. Fix: #10907 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? `./gradlew --no-daemon :server-common:test --tests org.apache.gravitino.server.authorization.jcasbin.TestJcasbinAuthorizer :core:test --tests org.apache.gravitino.authorization.TestAuthorizationRequestContext -PskipITs -PskipDockerTests=false` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
