From 327f1595dc82560a3a88c577ecc40ac7f92efaab Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Tue, 17 Sep 2019 20:11:19 +0200
Subject: [PATCH] when unchecking view, uncheck also write

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

diff --git a/frontend-js/src/main/js/gui/admin/EditUserDialog.js b/frontend-js/src/main/js/gui/admin/EditUserDialog.js
index 04c576213f..0c5d2f3c74 100644
--- a/frontend-js/src/main/js/gui/admin/EditUserDialog.js
+++ b/frontend-js/src/main/js/gui/admin/EditUserDialog.js
@@ -398,6 +398,12 @@ EditUserDialog.prototype.initProjectsTab = function () {
       }
       return self.grantPrivilege({privilegeType: type, objectId: projectId});
     } else {
+      if (type === PrivilegeType.READ_PROJECT) {
+        var writeCheckbox = $("[data='" + PrivilegeType.WRITE_PROJECT + ":" + data[1] + "']", self.getElement());
+        if (writeCheckbox.is(":checked")) {
+          writeCheckbox.click();
+        }
+      }
       return self.revokePrivilege({privilegeType: type, objectId: projectId});
     }
   });
-- 
GitLab