From f35eb397c84cefb35beb44871029ef07295ed76c Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Thu, 22 Mar 2018 15:40:25 +0100
Subject: [PATCH] default project privileges are saved on creation

---
 frontend-js/src/main/js/gui/admin/EditUserDialog.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/frontend-js/src/main/js/gui/admin/EditUserDialog.js b/frontend-js/src/main/js/gui/admin/EditUserDialog.js
index 83dc923fb4..50b13ce3e6 100644
--- a/frontend-js/src/main/js/gui/admin/EditUserDialog.js
+++ b/frontend-js/src/main/js/gui/admin/EditUserDialog.js
@@ -330,6 +330,19 @@ EditUserDialog.prototype.initProjectsTab = function () {
       }
     });
 
+    $("[name='defaultProjectsRow']", self.getElement()).on("click", "[name='project-privilege-checkbox']", function () {
+      var data = $(this).attr("data").split("-");
+      var privilegeType = data[0];
+      var objectId = data[1];
+      var value = $(this).is(":checked");
+      for (var i = 0; i < configuration.getPrivilegeTypes().length; i++) {
+        var privilege = configuration.getPrivilegeTypes()[i];
+        if (privilege.getName() === privilegeType) {
+          self.getUser().setPrivilege({type: privilege, value: value, objectId: objectId});
+        }
+      }
+    });
+
   });
 };
 
-- 
GitLab