Do not send active or role attributes for own user while edit

This commit is contained in:
Johannes Zellner
2020-03-05 16:23:27 -08:00
parent 256676cb9d
commit 7f95e11af1

View File

@@ -214,11 +214,15 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
var userId = $scope.useredit.userInfo.id;
var data = {
id: userId,
active: $scope.useredit.active,
role: $scope.useredit.role
id: userId
};
// only send if not the current active user
if (userId !== $scope.userInfo.id) {
data.active = $scope.useredit.active;
data.role = $scope.useredit.role;
}
// only change those if it is a local user
if (!$scope.useredit.source) {
data.email = $scope.useredit.email;