mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 10:35:55 +01:00
group creation and deletion from outside ACP, #2588
This commit is contained in:
@@ -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]]'));
|
||||
|
||||
Reference in New Issue
Block a user