@riocrypto/common-server 1.0.1492 → 1.0.1493
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -18,7 +18,7 @@ const authRoleOrder = [
|
|
|
18
18
|
];
|
|
19
19
|
const requireMinRole = (req, res, next, minRole) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
20
|
var _a;
|
|
21
|
-
if (!req.admin) {
|
|
21
|
+
if (!req.admin && !req.validClusterApiKey) {
|
|
22
22
|
if (authRoleOrder.indexOf((_a = req.auth) === null || _a === void 0 ? void 0 : _a.role) < authRoleOrder.indexOf(minRole)) {
|
|
23
23
|
throw new common_1.GenericInputError(`Insufficient permissions. This endpoint requires at least the ${minRole} role. Contact your account owner to change your access role.`);
|
|
24
24
|
}
|