Skip to content

Commit

Permalink
remove unused extract function
Browse files Browse the repository at this point in the history
  • Loading branch information
SiddharthMantri committed Oct 28, 2024
1 parent 162acae commit 42bf34d
Showing 1 changed file with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,31 +251,6 @@ export function privilegesFactory(
}, {}),
};
},
getFeatureForPrivilege(
searchTerm: string,
subFeaturePrivilegeIterator: SubFeaturePrivilegeIterator
) {
const features = featuresService.getKibanaFeatures();
const result: string[] = [];

features.forEach((feature) => {
if (feature.privileges?.all.api?.includes(searchTerm)) {
result.push(`${feature.id}.all`);
}

if (feature.privileges?.read && feature.privileges.read.api?.includes(searchTerm)) {
result.push(`${feature.id}.read`);
}

for (const subFeaturePrivilege of subFeaturePrivilegeIterator(feature, () => true)) {
if (subFeaturePrivilege.api?.includes(searchTerm)) {
result.push(`${feature.id}.${subFeaturePrivilege.id}`);
}
}
});

return result;
},
};
}

Expand Down

0 comments on commit 42bf34d

Please sign in to comment.