feat(auth): integrate normalizePermissionKeys for consistent permission handling
- Updated auth, admin, and auth-guards routes to utilize normalizePermissionKeys for permissions. - Enhanced permission mapping to ensure legacy keys are correctly transformed to current catalog keys. - Improved overall permission validation and user access management across the application.
This commit is contained in:
1 parent
cfbe1fceda
commit
21d6603b57
4 files changed
+42
-11
No files matched your search
@@ -6,7 +6,7 @@ import {
|
||||
type UserRow,
|
||||
} from '@authportal/db'
|
||||
import type { AppId, MeResponse } from '@authportal/shared'
|
||||
import { APP_IDS } from '@authportal/shared'
|
||||
import { APP_IDS, normalizePermissionKeys } from '@authportal/shared'
|
||||
|
||||
export type AuthUser = {
|
||||
id: string
|
||||
@@ -68,7 +68,9 @@ export function loadAuthUser(
|
||||
user: UserRow,
|
||||
): AuthUser {
|
||||
const apps = getUserApps(request.server.db, user.id)
|
||||
const permissions = getUserPermissions(request.server.db, user.id)
|
||||
const permissions = normalizePermissionKeys(
|
||||
getUserPermissions(request.server.db, user.id),
|
||||
)
|
||||
return {
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
|
||||
Reference in new issue
Block a user