From 6539feb6d7642394ab79f037df34b02fe07efb41 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 19 Oct 2021 16:19:48 +0100 Subject: [PATCH] Fixing issue with permissions, if some permissions have already been set for a role an error would be thrown which would break the UI and make it impossible to setup permissions for other tables. --- packages/server/src/api/controllers/permission.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/api/controllers/permission.js b/packages/server/src/api/controllers/permission.js index 6c02663649..c38740cb01 100644 --- a/packages/server/src/api/controllers/permission.js +++ b/packages/server/src/api/controllers/permission.js @@ -147,6 +147,7 @@ exports.getResourcePerms = async function (ctx) { const rolePerms = role.permissions if ( rolePerms && + rolePerms[resourceId] && (rolePerms[resourceId] === level || rolePerms[resourceId].indexOf(level) !== -1) ) {