UNPKG

@speckle/shared

Version:

Shared code between various Speckle JS packages

19 lines 893 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.canEditFunctionPolicy = void 0; const result_1 = require("true-myth/result"); const automate_js_1 = require("../../../fragments/automate.js"); const canEditFunctionPolicy = (loaders) => async ({ userId, functionId }) => { const isAutomateEnabled = await (0, automate_js_1.ensureAutomateEnabledFragment)(loaders)({}); if (isAutomateEnabled.isErr) return (0, result_1.err)(isAutomateEnabled.error); const isAutomateFunctionCreator = await (0, automate_js_1.ensureAutomateFunctionCreatorFragment)(loaders)({ userId, functionId }); if (isAutomateFunctionCreator.isErr) return (0, result_1.err)(isAutomateFunctionCreator.error); return (0, result_1.ok)(); }; exports.canEditFunctionPolicy = canEditFunctionPolicy; //# sourceMappingURL=canEditFunction.js.map