UNPKG

@speckle/shared

Version:

Shared code between various Speckle JS packages

20 lines 847 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.canReadAutomationPolicy = void 0; const result_1 = require("true-myth/result"); const projects_js_1 = require("../../../fragments/projects.js"); const constants_js_1 = require("../../../../core/constants.js"); const canReadAutomationPolicy = (loaders) => async ({ userId, projectId }) => { // Project reviewers may read automations const hasReadAccess = await (0, projects_js_1.ensureImplicitProjectMemberWithReadAccessFragment)(loaders)({ userId, projectId, role: constants_js_1.Roles.Stream.Reviewer }); if (hasReadAccess.isErr) { return (0, result_1.err)(hasReadAccess.error); } return (0, result_1.ok)(); }; exports.canReadAutomationPolicy = canReadAutomationPolicy; //# sourceMappingURL=canRead.js.map