Browse Source

fix: avoid preview as value in project list page

re #409

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/460/head
Pranav C 3 years ago
parent
commit
c14e57b2c3
  1. 10
      packages/nc-gui/pages/projects/index.vue
  2. 4
      packages/nc-gui/store/users.js

10
packages/nc-gui/pages/projects/index.vue

@ -75,7 +75,7 @@
</x-btn> </x-btn>
<!-- <x-btn <!-- <x-btn
btn.class="pl-1" btn.class="pl-1"
v-if="_isUIAllowed('projectCreate')" v-if="_isUIAllowed('projectCreate',true)"
outlined outlined
data-v-step="1" data-v-step="1"
color="primary" color="primary"
@ -87,7 +87,7 @@
</x-btn> </x-btn>
<x-btn <x-btn
btn.class="pl-1" btn.class="pl-1"
v-if="_isUIAllowed('projectCreate')" v-if="_isUIAllowed('projectCreate',true)"
outlined outlined
data-v-step="1" data-v-step="1"
color="primary" color="primary"
@ -103,7 +103,7 @@
<template #activator="{ on }"> <template #activator="{ on }">
<div> <div>
<x-btn <x-btn
v-if="_isUIAllowed('projectCreate')" v-if="_isUIAllowed('projectCreate',true)"
v-ge="['home', 'project-new']" v-ge="['home', 'project-new']"
outlined outlined
data-v-step="1" data-v-step="1"
@ -194,7 +194,7 @@
</v-menu> </v-menu>
</template> </template>
<x-btn <x-btn
v-else-if="_isUIAllowed('projectCreate')" v-else-if="_isUIAllowed('projectCreate',true)"
v-ge="['home', 'project-new']" v-ge="['home', 'project-new']"
outlined outlined
data-v-step="1" data-v-step="1"
@ -266,7 +266,7 @@
</td> </td>
<td> <td>
<div <div
v-if="_isUIAllowed('project.actions')" v-if="_isUIAllowed('project.actions',true)"
:class="{ :class="{
'action-icons': !( 'action-icons': !(
projectStatusUpdating && projectStatusUpdating &&

4
packages/nc-gui/store/users.js

@ -65,14 +65,14 @@ export const getters = {
GtrIsUIAllowed(state) { GtrIsUIAllowed(state) {
const rolePermissions = process.env.EE ? rolePermissionsEE : rolePermissionsCE const rolePermissions = process.env.EE ? rolePermissionsEE : rolePermissionsCE
return (page) => { return (page, ignorePreviewAs = false) => {
const user = state.user const user = state.user
let roles = { let roles = {
...((user && user.roles) || {}), ...((user && user.roles) || {}),
...(state.projectRole || {}) ...(state.projectRole || {})
} }
if (state.previewAs) { if (state.previewAs && !ignorePreviewAs) {
roles = { roles = {
[state.previewAs]: true [state.previewAs]: true
} }

Loading…
Cancel
Save