Browse Source

fix(nc-gui): row height access for viewer role

pull/7621/head
Ramesh Mane 7 months ago
parent
commit
17ce04bf2c
  1. 12
      packages/nc-gui/components/smartsheet/toolbar/RowHeight.vue

12
packages/nc-gui/components/smartsheet/toolbar/RowHeight.vue

@ -1,4 +1,5 @@
<script setup lang="ts">
import { OrgUserRoles, ProjectRoles, extractRolesObj } from 'nocodb-sdk'
import type { GridType } from 'nocodb-sdk'
import { ActiveViewInj, IsLockedInj, iconMap, inject, ref, storeToRefs, useMenuCloseOnEsc, useUndoRedo } from '#imports'
@ -14,6 +15,8 @@ const { $api } = useNuxtApp()
const { addUndo, defineViewScope } = useUndoRedo()
const { user } = useGlobal()
const open = ref(false)
const updateRowHeight = async (rh: number, undo = false) => {
@ -35,7 +38,14 @@ const updateRowHeight = async (rh: number, undo = false) => {
}
try {
if (!isPublic.value && !isSharedBase.value) {
if (
!isPublic.value &&
!isSharedBase.value &&
!(
extractRolesObj(user.value?.roles ?? {})[ProjectRoles.VIEWER] ||
extractRolesObj(user.value?.roles ?? {})[OrgUserRoles.VIEWER]
)
) {
await $api.dbView.gridUpdate(view.value.id, {
row_height: rh,
})

Loading…
Cancel
Save