Browse Source

fix: share project permission

pull/6399/head
mertmit 12 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> <template>
<div <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" class="flex flex-col justify-center h-full"
data-testid="share-project-button" data-testid="share-project-button"
:data-sharetype="visibility" :data-sharetype="visibility"

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

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

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

@ -249,7 +249,7 @@ watch(shared, () => {
<template> <template>
<div> <div>
<a-button <a-button
v-if="isUIAllowed('shareView') && !isSharedBase" v-if="isUIAllowed('viewShare') && !isSharedBase"
v-e="['c:view:share']" v-e="['c:view:share']"
outlined outlined
class="nc-btn-share-view nc-toolbar-btn" 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 { extractRolesObj } from 'nocodb-sdk'
import { computed, createSharedComposable, useApi, useGlobal } from '#imports' 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 * * `loadRoles` - a function to load reload user roles for scope
*/ */
export const useRoles = createSharedComposable(() => { export const useRoles = createSharedComposable(() => {
const { user, previewAs } = useGlobal() const { user } = useGlobal()
const { api } = useApi() const { api } = useApi()

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

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

Loading…
Cancel
Save