From: Benjamin Auder Date: Mon, 30 Mar 2020 13:28:55 +0000 (+0200) Subject: Fix pronlems edit by admins X-Git-Url: https://git.auder.net/variants/Baroque/current/%7B%7B%20asset%28%27mixstore/js/summernote.min.js%27%29%20%7D%7D?a=commitdiff_plain;h=a9e7935190d8fc112e674add05e86b8d0152e8df;p=vchess.git Fix pronlems edit by admins --- diff --git a/client/src/parameters.js.dist b/client/src/parameters.js.dist index 2e47407e..b7f0899b 100644 --- a/client/src/parameters.js.dist +++ b/client/src/parameters.js.dist @@ -7,7 +7,10 @@ const Parameters = serverUrl: "http://localhost:3000", // "include" if the server is at a different address - credentials: "same-origin" + credentials: "same-origin", + + // IDs of users allowed to post news and edit any problem + devs: [] }; export default Parameters; diff --git a/client/src/views/News.vue b/client/src/views/News.vue index 97f0eb84..37bd3cae 100644 --- a/client/src/views/News.vue +++ b/client/src/views/News.vue @@ -17,7 +17,7 @@ main .row .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 button#writeNewsBtn( - v-if="devs.includes(st.user.id)" + v-if="devTeam" @click="showModalNews" ) | {{ st.tr["Write news"] }} @@ -27,7 +27,7 @@ main :class="{margintop:idx>0}" ) span.ndt {{ formatDatetime(n.added) }} - .dev-buttons(v-if="devs.includes(st.user.id)") + .dev-buttons(v-if="devTeam") button(@click="editNews(n)") {{ st.tr["Edit"] }} button(@click="deleteNews(n)") {{ st.tr["Delete"] }} button(@click="gotoPrevNext(n, 1)") {{ st.tr["Previous_n"] }} @@ -43,14 +43,15 @@ main