changeset 5359:bf3d91d333ed extented-report

Sysadmins could assign every user as recipient. No further rolechecking necessary, since only sysadmins can manage users
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 22 Jun 2021 15:15:52 +0200
parents 32d45ddb7ccd
children f845c3b7b68e
files client/src/components/usermanagement/Userdetail.vue client/src/components/usermanagement/Usermanagement.vue
diffstat 2 files changed, 1 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/usermanagement/Userdetail.vue	Tue Jun 22 15:02:03 2021 +0200
+++ b/client/src/components/usermanagement/Userdetail.vue	Tue Jun 22 15:15:52 2021 +0200
@@ -109,7 +109,7 @@
               :passworderrors="errors.passwordre"
             />
           </div>
-          <div class="form-group row" v-if="DQLDownloadAllowed()">
+          <div class="form-group row">
             <label for="user">
               <translate>Recipient for DQL Report </translate>
             </label>
@@ -282,12 +282,6 @@
     }
   },
   methods: {
-    DQLDownloadAllowed() {
-      return (
-        this.currentUser.role === "waterway_admin" ||
-        this.currentUser.role === "sys_admin"
-      );
-    },
     passwordChanged(value) {
       this.password = value;
       this.validatePassword();
@@ -345,9 +339,6 @@
       if (!this.isFormValid) return;
       if (this.password) this.currentUser.password = this.password;
       this.submitted = true;
-      if (this.currentUser.role === "waterway_user") {
-        this.currentUser.reports = false;
-      }
       this.$store
         .dispatch("usermanagement/saveCurrentUser", {
           path: this.user.user,
--- a/client/src/components/usermanagement/Usermanagement.vue	Tue Jun 22 15:02:03 2021 +0200
+++ b/client/src/components/usermanagement/Usermanagement.vue	Tue Jun 22 15:15:52 2021 +0200
@@ -44,7 +44,6 @@
               </div>
               <div class="table-cell center col-1">
                 <toggle-button
-                  v-if="DQLDownloadAllowed(user)"
                   :value="user.reports"
                   v-model="user.reports"
                   class="pt-1"
@@ -216,9 +215,6 @@
     }
   },
   methods: {
-    DQLDownloadAllowed(user) {
-      return user.role === "waterway_admin" || user.role === "sys_admin";
-    },
     toggleReport(user) {
       HTTP.patch(
         `/users/${user.user}`,