@contentstack/live-preview-utils
Version:
Contentstack provides the Live Preview SDK to establish a communication channel between the various Contentstack SDKs and your website, transmitting live changes to the preview pane.
39 lines (38 loc) • 921 B
JavaScript
import "../../chunk-5WRI5ZAA.js";
// src/visualBuilder/utils/getEntryPermissions.ts
import { VisualBuilderPostMessageEvents } from "./types/postMessage.types.js";
import visualBuilderPostMessage from "./visualBuilderPostMessage.js";
async function getEntryPermissions({
entryUid,
contentTypeUid,
locale
}) {
var _a;
try {
const permissions = await ((_a = visualBuilderPostMessage) == null ? void 0 : _a.send(
VisualBuilderPostMessageEvents.GET_PERMISSIONS,
{
type: "entry",
entryUid,
contentTypeUid,
locale
}
));
if (permissions) {
return permissions;
}
} catch (error) {
console.debug("[Visual Builder] Error fetching permissions", error);
}
return {
create: true,
read: true,
update: true,
delete: true,
publish: true
};
}
export {
getEntryPermissions
};
//# sourceMappingURL=getEntryPermissions.js.map