Browse Source

fix(nc-gui): Hide Rename, Delete, Add record buttons when user doesn't have necessary permissions (#7871)

* fix(nc-gui): Remove tableRename, tableDelete from org level role permissions

For hiding Rename and Delete buttons in table context menu.

* fix(nc-gui): Hide Add record button when user doesn't have dataInsert permission
nc-revert-2521-feat/share-ui
IFGGit 8 months ago committed by GitHub
parent
commit
62414238ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
  2. 6
      packages/nc-gui/components/smartsheet/Kanban.vue
  3. 2
      packages/nc-gui/lib/acl.ts

2
packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue

@ -766,7 +766,7 @@ const projectDelete = () => {
</div>
</NcMenuItem>
<NcDivider />
<NcMenuItem v-if="isUIAllowed('table-delete')" class="!hover:bg-red-50" @click="tableDelete">
<NcMenuItem v-if="isUIAllowed('tableDelete')" class="!hover:bg-red-50" @click="tableDelete">
<div class="nc-base-option-item flex gap-2 items-center text-red-600">
<GeneralIcon icon="delete" />
{{ $t('general.delete') }}

6
packages/nc-gui/components/smartsheet/Kanban.vue

@ -513,7 +513,10 @@ const getRowId = (row: RowType) => {
</div>
</a-layout-header>
<a-layout-content class="overflow-y-hidden mt-1" style="max-height: calc(100% - 11rem)">
<a-layout-content
class="overflow-y-hidden mt-1"
:style="{ maxHeight: isUIAllowed('dataInsert') ? 'calc(100% - 11rem)' : 'calc(100% - 8rem)' }"
>
<div :ref="kanbanListRef" class="nc-kanban-list h-full nc-scrollbar-dark-md" :data-stack-title="stack.title">
<!-- Draggable Record Card -->
<Draggable
@ -665,6 +668,7 @@ const getRowId = (row: RowType) => {
</div>
<div
v-if="isUIAllowed('dataInsert')"
class="flex flex-row w-full mt-3 justify-between items-center cursor-pointer bg-white px-4 py-2 rounded-lg border-gray-100 border-1 shadow-sm shadow-gray-100"
@click="
() => {

2
packages/nc-gui/lib/acl.ts

@ -34,8 +34,6 @@ const rolePermissions = {
baseDelete: true,
baseDuplicate: true,
newUser: true,
tableRename: true,
tableDelete: true,
viewCreateOrEdit: true,
baseReorder: true,
},

Loading…
Cancel
Save