Browse Source
Merge pull request #7013 from Budibase/fix/fix-access-issue
Ensure auth access for builder and admins
master
Peter Clement
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
17 additions and
15 deletions
-
packages/builder/src/pages/builder/apps/index.svelte
|
|
|
@ -46,23 +46,25 @@ |
|
|
|
|
|
|
|
$: { |
|
|
|
if (!Object.keys($auth.user?.roles).length && $auth.user?.userGroups) { |
|
|
|
userApps = $auth.user?.builder?.global |
|
|
|
? publishedApps |
|
|
|
: publishedApps.filter(app => { |
|
|
|
return userGroups.find(group => { |
|
|
|
return Object.keys(group.roles) |
|
|
|
.map(role => apps.extractAppId(role)) |
|
|
|
.includes(app.appId) |
|
|
|
userApps = |
|
|
|
$auth.user?.builder?.global || $auth.user?.admin?.global |
|
|
|
? publishedApps |
|
|
|
: publishedApps.filter(app => { |
|
|
|
return userGroups.find(group => { |
|
|
|
return Object.keys(group.roles) |
|
|
|
.map(role => apps.extractAppId(role)) |
|
|
|
.includes(app.appId) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
userApps = $auth.user?.builder?.global |
|
|
|
? publishedApps |
|
|
|
: publishedApps.filter(app => |
|
|
|
Object.keys($auth.user?.roles) |
|
|
|
.map(x => apps.extractAppId(x)) |
|
|
|
.includes(app.appId) |
|
|
|
) |
|
|
|
userApps = |
|
|
|
$auth.user?.builder?.global || $auth.user?.admin?.global |
|
|
|
? publishedApps |
|
|
|
: publishedApps.filter(app => |
|
|
|
Object.keys($auth.user?.roles) |
|
|
|
.map(x => apps.extractAppId(x)) |
|
|
|
.includes(app.appId) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|