ensure auth access for builder and admins

This commit is contained in:
Peter Clement 2022-08-01 08:50:57 +01:00
parent 7dbd6ddd8d
commit 172662c59e
1 changed files with 18 additions and 16 deletions

View File

@ -43,10 +43,11 @@
)
let userApps = []
$: publishedApps = $apps.filter(publishedAppsOnly)
$: console.log($auth.user)
$: {
if (!Object.keys($auth.user?.roles).length && $auth.user?.userGroups) {
userApps = $auth.user?.builder?.global
userApps =
$auth.user?.builder?.global || $auth.user?.admin?.global
? publishedApps
: publishedApps.filter(app => {
return userGroups.find(group => {
@ -56,7 +57,8 @@
})
})
} else {
userApps = $auth.user?.builder?.global
userApps =
$auth.user?.builder?.global || $auth.user?.admin?.global
? publishedApps
: publishedApps.filter(app =>
Object.keys($auth.user?.roles)