mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-05 23:30:36 +01:00
dont check maximum group name length if it is a privilege group
This commit is contained in:
@@ -9,7 +9,9 @@ var db = require('../database');
|
||||
module.exports = function(Groups) {
|
||||
|
||||
Groups.create = function(data, callback) {
|
||||
var system = data.system === true || parseInt(data.system, 10) === 1 || data.name === 'administrators' || data.name === 'registered-users' || data.name === 'Global Moderators' || Groups.isPrivilegeGroup(data.name);
|
||||
var system = data.system === true || parseInt(data.system, 10) === 1 ||
|
||||
data.name === 'administrators' || data.name === 'registered-users' || data.name === 'Global Moderators' ||
|
||||
Groups.isPrivilegeGroup(data.name);
|
||||
var groupData;
|
||||
var timestamp = data.timestamp || Date.now();
|
||||
|
||||
@@ -79,7 +81,7 @@ module.exports = function(Groups) {
|
||||
return callback(new Error('[[error:group-name-too-short]]'));
|
||||
}
|
||||
|
||||
if (name.length > (parseInt(meta.config.maximumGroupNameLength, 10) || 255)) {
|
||||
if (!Groups.isPrivilegeGroup(data.name) && name.length > (parseInt(meta.config.maximumGroupNameLength, 10) || 255)) {
|
||||
return callback(new Error('[[error:group-name-too-long]]'));
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ Categories.update = function(socket, data, callback) {
|
||||
};
|
||||
|
||||
Categories.setPrivilege = function(socket, data, callback) {
|
||||
if(!data) {
|
||||
if (!data) {
|
||||
return callback(new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ Categories.getPrivilegeSettings = function(socket, cid, callback) {
|
||||
};
|
||||
|
||||
Categories.copyPrivilegesToChildren = function(socket, cid, callback) {
|
||||
categories.getCategories([cid], socket.uid, function(err, categories) {
|
||||
categories.getCategories([cid], socket.uid, function(err, categories) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var async = require('async');
|
||||
var groups = require('../../groups'),
|
||||
Groups = {};
|
||||
var groups = require('../../groups');
|
||||
|
||||
var Groups = {};
|
||||
|
||||
Groups.create = function(socket, data, callback) {
|
||||
if (!data) {
|
||||
|
||||
Reference in New Issue
Block a user