Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down
6 changes: 5 additions & 1 deletion packages/nc-gui/components/smartsheet/Kanban.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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="
() => {
Expand Down
2 changes: 0 additions & 2 deletions packages/nc-gui/lib/acl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ const rolePermissions = {
baseDelete: true,
baseDuplicate: true,
newUser: true,
tableRename: true,
tableDelete: true,
viewCreateOrEdit: true,
baseReorder: true,
},
Expand Down