"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function isEditable(bundle, _variable, profileName, iotizeStudioVariableConfig) {
    let acl = getAcl(bundle, profileName);
    if (!acl.write) {
        return false;
    }
    if (iotizeStudioVariableConfig) {
        return iotizeStudioVariableConfig.attribute("GUI_Submit") !== "No";
    }
    return true;
}
exports.isEditable = isEditable;
function hasReadOrWriteRights(bundle, profileName) {
    let acl = getAcl(bundle, profileName);
    return acl.read || acl.write;
}
exports.hasReadOrWriteRights = hasReadOrWriteRights;
function getAcl(bundle, profileName) {
    if (profileName === 'admin') {
        return {
            read: true,
            write: true
        };
    }
    if (!bundle.acls || !(profileName in bundle.acls)) {
        return {
            read: false,
            write: false
        };
    }
    return bundle.acls[profileName];
}
exports.getAcl = getAcl;
//# sourceMappingURL=generator.js.map