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.

This commit is contained in:
mike12345567 2021-10-19 16:19:48 +01:00
parent 340d52dc38
commit 3631a799c3
1 changed files with 1 additions and 0 deletions

View File

@ -147,6 +147,7 @@ exports.getResourcePerms = async function (ctx) {
const rolePerms = role.permissions const rolePerms = role.permissions
if ( if (
rolePerms && rolePerms &&
rolePerms[resourceId] &&
(rolePerms[resourceId] === level || (rolePerms[resourceId] === level ||
rolePerms[resourceId].indexOf(level) !== -1) rolePerms[resourceId].indexOf(level) !== -1)
) { ) {