Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Merge branch 'IR-2666-Studio-No-assets-showing-up-in-Assets-Panel' of h…
Browse files Browse the repository at this point in the history
…ttps://github.com/EtherealEngine/etherealengine into IR-2666-Studio-No-assets-showing-up-in-Assets-Panel
  • Loading branch information
HexaField committed Jun 27, 2024
2 parents 56528fc + f37b15d commit 3c33986
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
projectPath,
projectPermissionPath
} from '@etherealengine/common/src/schema.type.module'
import { Forbidden } from '@feathersjs/errors'
import { Paginated } from '@feathersjs/feathers'
import { Application, HookContext } from '../../declarations'
/**
Expand All @@ -48,14 +49,18 @@ export default () => {
}
})) as Paginated<ProjectPermissionType>

if (data.length === 0) {
console.error(`No Project permissions found. UserId: ${loggedInUser.id}`)
throw new Forbidden(`Project permissions not found`)
}

for (const projP of data) {
if (!context.params.query?.$or) {
context.params.query.$or = []
}
const project = await context.app.service(projectPath).get(projP.projectId)
if (project !== undefined) context.params.query?.$or?.push({ project: project.name })
}
context.params.query?.$or?.push({ project: 'default-project' })
return context
}
return context
Expand Down

0 comments on commit 3c33986

Please sign in to comment.