//#import $owl_orgs:services/modelService.jsx
//#import $owlService:services/org/OrgUtil.jsx

function main() {
    var env = ctx.get("env");
    var jOrg = ctx.get("data");

    var roleId = env.roleId
    var orgId = env.orgId;
    var userId = env.loginUserId;

    $.log("doCheckBeforeAddOrUpdate.jsx...env.orgId=" + orgId + "...jOrg.id=" + jOrg.id + "...userId=" + userId + "...roleId=" + roleId);
    if(orgId != "0" && jOrg.orgType == "org") {
        $.log("doCheckBeforeAddOrUpdate.jsx...env.orgId=" + orgId + "...抱歉，您无权删除组织机构");
        throw "抱歉，您无权删除组织机构";
    }
}

main();
