check for schedule permission

This commit is contained in:
Mads Rasmussen
2022-05-12 18:06:41 +02:00
parent 7405cbe6ef
commit dae338b4e8
2 changed files with 6 additions and 0 deletions

View File

@@ -322,6 +322,7 @@
<key alias="variantSaveNotAllowed">Save is not allowed</key>
<key alias="variantPublishNotAllowed">Publish is not allowed</key>
<key alias="variantSendForApprovalNotAllowed">Send for approval is not allowed</key>
<key alias="variantScheduleNotAllowed">Schedule is not allowed</key>
</area>
<area alias="blueprints">
<key alias="createBlueprintFrom"><![CDATA[Create a new Content Template from <em>%0%</em>]]></key>

View File

@@ -43,6 +43,7 @@
// Check for variants: if a node is invariant it will still have the default language in variants
// so we have to check for length > 1
if (vm.variants.length > 1) {
vm.displayVariants = vm.displayVariants.filter(variant => allowPublish(variant));
vm.displayVariants = contentEditingHelper.getSortedVariantsAndSegments(vm.displayVariants);
vm.variants.forEach(v => {
@@ -83,6 +84,10 @@
});
}
function allowPublish (variant) {
return variant.allowedActions.includes("U");
}
/**
* Callback when date is set up
* @param {any} variant