Browse Source

fix: share project permission

pull/6399/head
mertmit 10 months ago
parent
commit
08d215e70f
  1. 2
      packages/nc-gui/components/general/ShareProject.vue
  2. 2
      packages/nc-gui/components/smartsheet/toolbar/MoreActions.vue
  3. 2
      packages/nc-gui/components/smartsheet/toolbar/ShareView.vue
  4. 4
      packages/nc-gui/composables/useRoles/index.ts
  5. 3
      packages/nc-gui/lib/constants.ts

2
packages/nc-gui/components/general/ShareProject.vue

@ -36,7 +36,7 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
<template>
<div
v-if="isUIAllowed('shareProject') && visibility !== 'hidden' && (activeTable || project)"
v-if="isUIAllowed('projectShare') && visibility !== 'hidden' && (activeTable || project)"
class="flex flex-col justify-center h-full"
data-testid="share-project-button"
:data-sharetype="visibility"

2
packages/nc-gui/components/smartsheet/toolbar/MoreActions.vue

@ -146,7 +146,7 @@ const exportFile = async (exportType: ExportTypes) => {
</div>
<div
v-if="isUIAllowed('shareView') && !isView && !isPublicView"
v-if="isUIAllowed('viewShare') && !isView && !isPublicView"
v-e="['a:actions:shared-view-list']"
class="nc-menu-item"
@click="sharedViewListDlg = true"

2
packages/nc-gui/components/smartsheet/toolbar/ShareView.vue

@ -249,7 +249,7 @@ watch(shared, () => {
<template>
<div>
<a-button
v-if="isUIAllowed('shareView') && !isSharedBase"
v-if="isUIAllowed('viewShare') && !isSharedBase"
v-e="['c:view:share']"
outlined
class="nc-btn-share-view nc-toolbar-btn"

4
packages/nc-gui/composables/useRoles/index.ts

@ -1,4 +1,4 @@
import type { Roles, RolesObj } from 'nocodb-sdk'
import type { RolesObj } from 'nocodb-sdk'
import { extractRolesObj } from 'nocodb-sdk'
import { computed, createSharedComposable, useApi, useGlobal } from '#imports'
@ -11,7 +11,7 @@ import { computed, createSharedComposable, useApi, useGlobal } from '#imports'
* * `loadRoles` - a function to load reload user roles for scope
*/
export const useRoles = createSharedComposable(() => {
const { user, previewAs } = useGlobal()
const { user } = useGlobal()
const { api } = useApi()

3
packages/nc-gui/lib/constants.ts

@ -73,11 +73,12 @@ const rolePermissions = {
settingsPage: true,
newUser: true,
webhook: true,
shareView: true,
fieldEdit: true,
fieldAdd: true,
tableIconEdit: true,
viewCreateOrEdit: true,
viewShare: true,
projectShare: true,
},
},
[ProjectRoles.EDITOR]: {

Loading…
Cancel
Save