group creation and deletion from outside ACP, #2588

This commit is contained in:
Julian Lam
2015-01-12 13:00:23 -05:00
parent 765975e667
commit 635393a274
5 changed files with 64 additions and 4 deletions

View File

@@ -101,6 +101,17 @@ SocketGroups.update = function(socket, data, callback) {
});
};
SocketGroups.create = function(socket, data, callback) {
if(!data) {
return callback(new Error('[[error:invalid-data]]'));
} else if (socket.uid === 0) {
return callback(new Error('[[error:no-privileges]]'));
}
data.ownerUid = socket.uid;
groups.create(data, callback);
};
SocketGroups.delete = function(socket, data, callback) {
if(!data) {
return callback(new Error('[[error:invalid-data]]'));