f501cc4ad5
* WIP can create project * WIP can create project more work * complete body, stencil tests * feat(shared): move workspace plan types into shared * test progress wip * feat(shared): add more logic to canCreateWorkspaceProject * a few more tests, as a treat * chore(authz): round out tests * fixed loaders, new GQL checks, dataLoaders in auth loaders * fix(authz): get workspace limits loader * chore(authz): update loaders * frontend fixed up to snuff * fix(authz): fix workspace plans for tests * fix(authz): classic * fix(authz): 0 counts --------- Co-authored-by: Chuck Driesler <chuck@speckle.systems> Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
20 lines
536 B
TypeScript
20 lines
536 B
TypeScript
import { Resolvers } from '@/modules/core/graph/generated/graphql'
|
|
import { Authz } from '@speckle/shared'
|
|
|
|
export default {
|
|
Workspace: {
|
|
permissions: (parent) => ({
|
|
workspaceId: parent.id
|
|
})
|
|
},
|
|
WorkspacePermissionChecks: {
|
|
canCreateProject: async (parent, _args, ctx) => {
|
|
const canCreateProject = await ctx.authPolicies.workspace.canCreateProject({
|
|
workspaceId: parent.workspaceId,
|
|
userId: ctx.userId
|
|
})
|
|
return Authz.toGraphqlResult(canCreateProject)
|
|
}
|
|
}
|
|
} as Resolvers
|