Browse Source

Merge pull request #7621 from nocodb/nc-fix/grid-row-height-viewer

Nc fix(nc-gui): row height access for viewer role
pull/7629/head
Raju Udava 10 months ago committed by GitHub
parent
commit
73fbd27025
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  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"> <script setup lang="ts">
import { OrgUserRoles, ProjectRoles, extractRolesObj } from 'nocodb-sdk'
import type { GridType } from 'nocodb-sdk' import type { GridType } from 'nocodb-sdk'
import { ActiveViewInj, IsLockedInj, iconMap, inject, ref, storeToRefs, useMenuCloseOnEsc, useUndoRedo } from '#imports' import { ActiveViewInj, IsLockedInj, iconMap, inject, ref, storeToRefs, useMenuCloseOnEsc, useUndoRedo } from '#imports'
@ -14,6 +15,8 @@ const { $api } = useNuxtApp()
const { addUndo, defineViewScope } = useUndoRedo() const { addUndo, defineViewScope } = useUndoRedo()
const { user } = useGlobal()
const open = ref(false) const open = ref(false)
const updateRowHeight = async (rh: number, undo = false) => { const updateRowHeight = async (rh: number, undo = false) => {
@ -35,7 +38,14 @@ const updateRowHeight = async (rh: number, undo = false) => {
} }
try { 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, { await $api.dbView.gridUpdate(view.value.id, {
row_height: rh, row_height: rh,
}) })

Loading…
Cancel
Save