Add roles UI creating and editing a group
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user