浏览代码

different min length for user vs admin

tags/v1.2.5
Jonathan Cobb 4 年前
父节点
当前提交
befcec9df4
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. +5
    -2
      bubble-server/src/main/java/bubble/model/cloud/BubbleNetwork.java

+ 5
- 2
bubble-server/src/main/java/bubble/model/cloud/BubbleNetwork.java 查看文件

@@ -88,7 +88,8 @@ public class BubbleNetwork extends IdentifiableBase implements HasNetwork, HasBu
@Transient @JsonIgnore public String getNetwork () { return getUuid(); }

public static final int NETWORK_NAME_MAXLEN = 100;
public static final int NETWORK_NAME_MINLEN = 4;
public static final int NETWORK_NAME_MINLEN = 3;
public static final int NETWORK_NAME_MINLEN_USER = 4;

@ECSearchable @ECField(index=10)
@HasValue(message="err.name.required")
@@ -243,7 +244,9 @@ public class BubbleNetwork extends IdentifiableBase implements HasNetwork, HasBu
errors.addViolation("err.name.reserved");
} else if (name.length() > NETWORK_NAME_MAXLEN) {
errors.addViolation("err.name.length");
} else if (name.length() < NETWORK_NAME_MINLEN && !owner.admin()) {
} else if (name.length() < NETWORK_NAME_MINLEN_USER && !owner.admin()) {
errors.addViolation("err.name.tooShort");
} else if (name.length() < NETWORK_NAME_MINLEN && owner.admin()) {
errors.addViolation("err.name.tooShort");
} else {
for (int i=0; i<100; i++) {


正在加载...
取消
保存