UNPKG

n8n

Version:

n8n Workflow Automation Tool

14 lines 703 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.assertCanManageRoleType = assertCanManageRoleType; const permissions_1 = require("@n8n/permissions"); const constants_1 = require("../constants"); const forbidden_error_1 = require("../errors/response-errors/forbidden.error"); function assertCanManageRoleType(user, roleType) { if ((0, permissions_1.hasGlobalScope)(user, 'role:manage')) return; if (roleType === 'project' && (0, permissions_1.hasGlobalScope)(user, 'role:manageProject')) return; throw new forbidden_error_1.ForbiddenError(constants_1.RESPONSE_ERROR_MESSAGES.MISSING_SCOPE); } //# sourceMappingURL=role-authorization.js.map