diff --git a/src/js/client.js b/src/js/client.js index f504915fe..b5c8a4193 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -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: { diff --git a/src/views/users.html b/src/views/users.html index 882904bc0..ef20508f8 100644 --- a/src/views/users.html +++ b/src/views/users.html @@ -154,6 +154,26 @@ {{ groupAdd.error.name }} + +
+
+ +
+ +
+
+ +
+
+ +
+
@@ -166,6 +186,49 @@ + + +