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

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

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

Loading…
Cancel
Save