All Downloads are FREE. Search and download functionalities are using the official Maven repository.

policy-management.eakApplyTopLevelPolicy.js Maven / Gradle / Ivy

There is a newer version: 2.5.3
Show newest version
window.eakApplyTopLevelPolicy = editable => {
    const {config} = editable;
    const rules = JSON.parse('%s').rules;
    const containers = rules.flatMap((rule) => rule.containers);
    const resName = containers.find((container) => config.path.endsWith(container));

    const filteredRules = rules.filter((rule) => (rule.containers || []).includes(resName));
    if (!filteredRules || !filteredRules.length) {
        return;
    }
    const listenerJson = {isEditConfig: true, rules: filteredRules};
    const updatecomponentlist = Granite.PolicyResolver.build(JSON.stringify(listenerJson));
    config.editConfig.listeners = Object.assign({}, config.editConfig.listeners, {updatecomponentlist});
    config.eakResourceName = resName;

};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy