Skip to content

Commit

Permalink
Merge pull request #4655 from Countly/permission-fix
Browse files Browse the repository at this point in the history
[SER-924] Add feature check in rights
  • Loading branch information
kanwarujjaval authored Nov 1, 2023
2 parents 15ee93e + 1946bd3 commit 0369b37
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions api/utils/rights.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,12 @@ exports.validateRead = function(params, feature, callback, callbackParam) {
}
else {
isFeatureAllowedInReadPermissionObject = false;
for (var i = 0; i < feature.length; i++) {
if (isPermissionObjectExistForRead && (member.permission.r[params.qstring.app_id].all || (member.permission.r[params.qstring.app_id].allowed && member.permission.r[params.qstring.app_id].allowed[feature[i]]))) {
isFeatureAllowedInReadPermissionObject = true;
break;
if (feature) {
for (var i = 0; i < feature.length; i++) {
if (isPermissionObjectExistForRead && (member.permission.r[params.qstring.app_id].all || (member.permission.r[params.qstring.app_id].allowed && member.permission.r[params.qstring.app_id].allowed[feature[i]]))) {
isFeatureAllowedInReadPermissionObject = true;
break;
}
}
}
}
Expand Down

0 comments on commit 0369b37

Please sign in to comment.