Add permissions UI

This commit is contained in:
Johannes Zellner
2020-02-17 14:05:26 +01:00
parent 016e2b375d
commit aba233c74a
3 changed files with 21 additions and 2 deletions

View File

@@ -181,6 +181,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
active: false,
source: '',
selectedGroups: [],
role: '',
show: function (userInfo) {
$scope.useredit.error = {};
@@ -192,6 +193,8 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$scope.useredit.admin = userInfo.admin;
$scope.useredit.active = userInfo.active;
$scope.useredit.source = userInfo.source;
// TODO once we have more roles, we have to change this
$scope.useredit.role = userInfo.permissions ? userInfo.permissions[0] : '';
$scope.useredit_form.$setPristine();
$scope.useredit_form.$setUntouched();
@@ -207,7 +210,8 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
var data = {
id: userId,
admin: $scope.useredit.admin,
active: $scope.useredit.active
active: $scope.useredit.active,
permissions: $scope.useredit.role ? [ $scope.useredit.role ] : null
};
// only change those if it is a local user