Browse Source

fix(gui): hide options based on role

re #168

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/510/head
Pranav C 3 years ago
parent
commit
574fd1ad2a
  1. 2
      packages/nc-gui/components/project/spreadsheet/components/virtualCell/belogsToCell.vue
  2. 2
      packages/nc-gui/components/project/spreadsheet/components/virtualCell/components/itemChip.vue
  3. 8
      packages/nc-gui/components/project/spreadsheet/components/virtualCell/components/listChildItems.vue

2
packages/nc-gui/components/project/spreadsheet/components/virtualCell/belogsToCell.vue

@ -2,7 +2,7 @@
<div class="d-flex d-100 chips-wrapper" :class="{active}"> <div class="d-flex d-100 chips-wrapper" :class="{active}">
<template v-if="!isForm"> <template v-if="!isForm">
<div class="chips d-flex align-center img-container flex-grow-1 hm-items"> <div class="chips d-flex align-center img-container flex-grow-1 hm-items">
<template v-if="value || localState"> <template v-if="(value || localState)&& _isUIAllowed('xcDatatableEditable') ">
<item-chip <item-chip
:active="active" :active="active"
:item="value" :item="value"

2
packages/nc-gui/components/project/spreadsheet/components/virtualCell/components/itemChip.vue

@ -9,7 +9,7 @@
> >
<!-- <span class="name" :title="value">{{ value }}</span>--> <!-- <span class="name" :title="value">{{ value }}</span>-->
<slot><span class="name" :title="value">{{ value }}</span></slot> <slot><span class="name" :title="value">{{ value }}</span></slot>
<div v-show="active" v-if="!readonly" class="mr-n1 ml-2"> <div v-show="active" v-if="!readonly && _isUIAllowed('table-remove-linked-record')" class="mr-n1 ml-2">
<x-icon <x-icon
:color="['text' , 'textLight']" :color="['text' , 'textLight']"
x-small x-small

8
packages/nc-gui/components/project/spreadsheet/components/virtualCell/components/listChildItems.vue

@ -24,7 +24,7 @@
</v-card-title> </v-card-title>
<v-card-text> <v-card-text>
<div class="items-container pt-2 mb-n4" :class="{'mx-n2' : isForm}"> <div class="items-container pt-2 mb-n4" :class="{'mx-n2' : isForm}">
<div v-if="!readOnly" class="text-right mb-2 mt-n2 mx-2"> <div v-if="!readOnly && _isUIAllowed('xcDatatableEditable')" class="text-right mb-2 mt-n2 mx-2">
<v-btn <v-btn
v-if="isForm" v-if="isForm"
x-small x-small
@ -47,11 +47,11 @@
:key="i" :key="i"
class="mx-2 mb-2 child-list-modal child-card" class="mx-2 mb-2 child-list-modal child-card"
outlined outlined
@click="!readOnly && $emit('edit',ch)" @click="!readOnly && $emit('edit',ch) && _isUIAllowed('xcDatatableEditable')"
> >
<div class="remove-child-icon d-flex align-center"> <div class="remove-child-icon d-flex align-center">
<x-icon <x-icon
v-if="!readOnly" v-if="!readOnly&& _isUIAllowed('xcDatatableEditable')"
:tooltip="`Unlink this '${meta._tn}' from '${parentMeta._tn}'`" :tooltip="`Unlink this '${meta._tn}' from '${parentMeta._tn}'`"
:color="['error','grey']" :color="['error','grey']"
small small
@ -61,7 +61,7 @@
mdi-link-variant-remove mdi-link-variant-remove
</x-icon> </x-icon>
<x-icon <x-icon
v-if="!mm && !bt && !readOnly" v-if="!mm && !bt && !readOnly&& _isUIAllowed('xcDatatableEditable')"
:tooltip="`Delete row in '${meta._tn}'`" :tooltip="`Delete row in '${meta._tn}'`"
:color="['error','grey']" :color="['error','grey']"
small small

Loading…
Cancel
Save