paultofunmi opened a new issue, #144: URL: https://github.com/apache/fineract-backoffice-ui/issues/144
## Problem Fineract's `GET /permissions` (and the login/authentication response's `permissions[]`) contains seed-data quality issues: some permission codes have a trailing space, producing duplicates like: - `"CREATE_STANDINGINSTRUCTION"` (clean) - `"CREATE_STANDINGINSTRUCTION "` (trailing space) `AuthService.hasPermission()` does exact string matching against `user.permissions`. A clean requirement string like `'READ_STANDINGINSTRUCTION'` silently fails to match if the backend only ever returned the dirty, space-suffixed variant for that user's role — the UI element/nav item stays hidden even though the user does have the permission. ## Impact Discovered while gating Standing Instructions nav items in #142 — `READ_STANDINGINSTRUCTION` only exists with a trailing space in some permission dumps, with no clean version guaranteed. Any future permission-gated feature is at risk of the same silent mismatch. ## Fix Normalize (trim + dedupe) `permissions[]` at the single point it enters the app — `AuthService.setSession()` (fresh login) and `getStoredSession()` (existing session read from `sessionStorage`) — so every downstream consumer (`hasPermission()`, `*appHasPermission`, `NavigationConfigService`) is correct automatically, with no changes needed at individual call sites. ## Out of scope - Fixing Fineract's backend seed data (server-side, different repo) -- 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]
