Add roles UI creating and editing a group

This commit is contained in:
Girish Ramakrishnan
2018-06-18 17:45:09 -07:00
parent 5bd57b6dbd
commit 12b1909c7a
3 changed files with 156 additions and 6 deletions

View File

@@ -687,9 +687,10 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
}).error(defaultErrorHandler(callback));
};
Client.prototype.createGroup = function (name, callback) {
Client.prototype.createGroup = function (name, roles, callback) {
var data = {
name: name
name: name,
roles: roles
};
post('/api/v1/groups', data).success(function(data, status) {
@@ -698,6 +699,18 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
}).error(defaultErrorHandler(callback));
};
Client.prototype.updateGroup = function (id, name, roles, callback) {
var data = {
name: name,
roles: roles
};
post('/api/v1/groups/' + id, data).success(function(data, status) {
if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data));
callback(null, data);
}).error(defaultErrorHandler(callback));
};
Client.prototype.removeGroup = function (groupId, password, callback) {
var config = {
data: {