Browse Source

fixed unallowed cards access for free users

bach 2 years ago
parent
commit
9b49e1bf20

File diff suppressed because it is too large
+ 0 - 0
web/themes/custom/materiotheme/assets/dist/main.js


BIN
web/themes/custom/materiotheme/assets/dist/main.js.gz


File diff suppressed because it is too large
+ 0 - 0
web/themes/custom/materiotheme/assets/dist/module-article.bundle.js


BIN
web/themes/custom/materiotheme/assets/dist/module-article.bundle.js.gz


File diff suppressed because it is too large
+ 0 - 0
web/themes/custom/materiotheme/assets/dist/module-base.bundle.js


BIN
web/themes/custom/materiotheme/assets/dist/module-base.bundle.js.gz


File diff suppressed because it is too large
+ 0 - 0
web/themes/custom/materiotheme/assets/dist/module-thematique.bundle.js


BIN
web/themes/custom/materiotheme/assets/dist/module-thematique.bundle.js.gz


File diff suppressed because it is too large
+ 1 - 1
web/themes/custom/materiotheme/assets/dist/report.html


+ 7 - 6
web/themes/custom/materiotheme/vuejs/components/Content/Card.vue

@@ -3,11 +3,11 @@
     <header
       @click.prevent="openModalCard"
     >
-      <h1 v-if="isloggedin">{{ item.title }}</h1>
+      <h1 v-if="hasDBAccess">{{ item.title }}</h1>
       <h4>{{ item.short_description }}</h4>
-      <span v-if="isloggedin" class="ref">{{ item.reference }}</span>
+      <span v-if="hasDBAccess" class="ref">{{ item.reference }}</span>
     </header>
-    <nav class="tools" v-if="isloggedin">
+    <nav class="tools" v-if="hasDBAccess">
       <section class="tool flags">
         <span class="btn mdi mdi-folder-outline"/>
         <div class="tool-content">
@@ -117,7 +117,8 @@ export default {
   computed: {
     ...mapState({
       flagcolls: state => state.User.flagcolls,
-      isloggedin: state => state.User.isloggedin
+      isloggedin: state => state.User.isloggedin,
+      hasDBAccess: state => state.User.hasDBAccess
     }),
     collsLength() {
       return Object.keys(this.flagcolls).length
@@ -192,8 +193,8 @@ export default {
     //   this.lightbox_index = index
     // },
     openModalCard (e) {
-      console.log('openModalCard', this.isLoggedin)
-      if (this.isloggedin) {
+      console.log('openModalCard', this.hasDBAccess)
+      if (this.hasDBAccess) {
         this.$modal.show(
           ModalCard,
           {

+ 5 - 1
web/themes/custom/materiotheme/vuejs/store/modules/user.js

@@ -5,7 +5,7 @@ import qs from 'querystring-es3'
 
 import materiauGQL from 'vuejs/api/gql/materiauflaglist.fragment.gql'
 
-import router from 'vuejs/route' // this is not working
+// import router from 'vuejs/route' // this is not working
 
 export default {
   namespaced: true,
@@ -24,6 +24,7 @@ export default {
     isAdmin: false,
     isAdherent: false,
     canSearch: false,
+    hasDBAccess: false,
     roles: [],
     flagcolls: false,
     flagcollsLoadedItems: {},
@@ -85,6 +86,9 @@ export default {
         state.canSearch = true
         state.isAdherent = true
       }
+      if (state.isAdherent || state.isAdmin) {
+        state.hasDBAccess = true
+      }
     },
     setLoggedOut (state) {
       console.log('setLoggedOut state', state)

Some files were not shown because too many files changed in this diff