Browse Source
Feature/handle undefined user in isRestrictedView() of permissions (#5569)
* Handle undefined user
main
Thomas Kaul
14 hours ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
0 deletions
-
libs/common/src/lib/permissions.ts
|
@ -197,5 +197,9 @@ export function hasRole(aUser: UserWithSettings, aRole: Role) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export function isRestrictedView(aUser: UserWithSettings) { |
|
|
export function isRestrictedView(aUser: UserWithSettings) { |
|
|
|
|
|
if (!aUser) { |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return aUser?.settings?.settings?.isRestrictedView ?? false; |
|
|
return aUser?.settings?.settings?.isRestrictedView ?? false; |
|
|
} |
|
|
} |
|
|