[oform] Add role.js to config

This commit is contained in:
KirillovIlya
2022-11-24 19:22:25 +03:00
parent bee49e0d83
commit 5a9821cc95
2 changed files with 7 additions and 1 deletions

View File

@ -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;