Browse Source

fix(gui-v2): handle opening shared view/base opening in same window

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3453/head
Pranav C 2 years ago
parent
commit
174c9a8957
  1. 4
      packages/nc-gui-v2/composables/useProject.ts
  2. 1
      packages/nc-gui-v2/composables/useUIPermission/index.ts
  3. 6
      packages/nc-gui-v2/composables/useUIPermission/rolePermissions.ts

4
packages/nc-gui-v2/composables/useProject.ts

@ -78,8 +78,10 @@ const [setup, use] = useInjectionState((_projectId?: MaybeRef<string>) => {
if (projectType === 'base') { if (projectType === 'base') {
const baseData = await $api.public.sharedBaseGet(route.params.projectId as string) const baseData = await $api.public.sharedBaseGet(route.params.projectId as string)
project.value = await $api.project.read(baseData.project_id!) project.value = await $api.project.read(baseData.project_id!)
} else { } else if (projectId.value) {
project.value = await $api.project.read(projectId.value) project.value = await $api.project.read(projectId.value)
} else {
return
} }
await loadProjectRoles() await loadProjectRoles()
await loadTables() await loadTables()

1
packages/nc-gui-v2/composables/useUIPermission/index.ts

@ -17,7 +17,6 @@ export function useUIPermission() {
return acc return acc
}, {}) }, {})
} }
// merge user role and project specific user roles // merge user role and project specific user roles
const roles = { const roles = {
...userRoles, ...userRoles,

6
packages/nc-gui-v2/composables/useUIPermission/rolePermissions.ts

@ -1,5 +1,9 @@
const rolePermissions = { const rolePermissions = {
super: '*', /** todo: enable wildcard permission
* limited permission due to unexpected behaviour in shared base if opened in same window */
super: {
projectTheme: true,
},
creator: '*', creator: '*',
owner: '*', owner: '*',
guest: {}, guest: {},

Loading…
Cancel
Save