diff --git a/configs/word.json b/configs/word.json index d28b017..bad80e7 100644 --- a/configs/word.json +++ b/configs/word.json @@ -7,6 +7,7 @@ "common": [ "apiBuilder.js", "oform/OForm.js", + "oform/Role.js", "oform/Document.js", "oform/FieldGroup.js", "oform/FieldMaster.js", diff --git a/oform/OForm.js b/oform/OForm.js index 7ac65d4..1fa3e7b 100644 --- a/oform/OForm.js +++ b/oform/OForm.js @@ -73,7 +73,12 @@ */ OForm.prototype.addRole = function(roleSettings) { - let name = roleSettings instanceof AscOForm.CRoleSettings ? roleSettings.getName() : roleSettings; + let name = ""; + if ("string" === typeof roleSettings) + name = roleSettings; + else if (roleSettings instanceof AscOForm.CRoleSettings) + name = roleSettings.getName(); + if (this.haveRole(name)) return false;