Browse Source

fix: permission name

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/6307/head
mertmit 1 year ago
parent
commit
e85ca75734
  1. 2
      packages/nc-gui/components/workspace/CreateProjectBtn.vue
  2. 6
      packages/nc-gui/store/workspace.ts
  3. 2
      packages/nocodb-sdk/src/lib/helperFunctions.ts

2
packages/nc-gui/components/workspace/CreateProjectBtn.vue

@ -28,7 +28,7 @@ const centered = computed(() => props.centered ?? true)
<template>
<NcButton
v-if="isUIAllowed('createProject', false, workspaceRoles ?? orgRoles) && !isSharedBase"
v-if="isUIAllowed('projectCreate', false, workspaceRoles ?? orgRoles) && !isSharedBase"
type="text"
:size="size"
:centered="centered"

6
packages/nc-gui/store/workspace.ts

@ -65,17 +65,17 @@ export const useWorkspace = defineStore('workspaceStore', () => {
/** getters */
const isWorkspaceCreator = computed(() => {
// todo: type correction
return orgRoles.value[Role.OrgLevelCreator]
return orgRoles.value?.[Role.OrgLevelCreator]
})
const isWorkspaceOwner = computed(() => {
// todo: type correction
return orgRoles.value[Role.OrgLevelCreator]
return orgRoles.value?.[Role.OrgLevelCreator]
})
const isWorkspaceOwnerOrCreator = computed(() => {
// todo: type correction
return orgRoles.value[Role.OrgLevelCreator]
return orgRoles.value?.[Role.OrgLevelCreator]
})
/** actions */

2
packages/nocodb-sdk/src/lib/helperFunctions.ts

@ -28,7 +28,7 @@ type Roles = Record<
>;
const extractRolesObj = (roles: Roles | string[] | string): Roles => {
if (!roles) return {};
if (!roles) return null;
if (typeof roles === 'object' && !Array.isArray(roles)) return roles;

Loading…
Cancel
Save