fix(calm-hub): Adding permission filtering to GET:/namespaces endpoin…#2639
fix(calm-hub): Adding permission filtering to GET:/namespaces endpoin…#2639ConfuddledPenguin wants to merge 1 commit into
Conversation
|
|
1486b99 to
7324a7f
Compare
|
@ConfuddledPenguin this may require minor coordination with #2640 due to that PR introducing |
| Set<String> grants = userAccessValidatorInstance.get() | ||
| .getReadableNamespaces(identity.getPrincipal().getName()); | ||
| return new ValueWrapper<>(namespaceStore.getNamespaces().stream() | ||
| .filter(ns -> grants.contains(ns.getName())) |
There was a problem hiding this comment.
Logic makes sense here, but one question: if line 65 already returns the list of readable namespaces for the user, why do we need to retrieve it again from namespaceStore? Can we not just return the readable namespaces directly, saving a query?
finos#2609) Adding in memory filtering of namespaces based on the users permissions following the pattern used in SearchResource.java.
7324a7f to
e30fc1f
Compare
|
Looks like a few conflicts and a few things to updated. Thanks @ConfuddledPenguin for the work so far |
|
@ConfuddledPenguin are you able to fix up this PR? |
|
Closing for now, please reopen if you get time to come back to this |
…t (#2609)
Adding in memory filtering of namespaces based on the users permissions following the pattern used in SearchResource.java
Description
Updating the existing
GET:/namespacesendpoint so that the returned namespaces are filtered based on a users permissions. This is done in memory, rather than at the DB level, following the pattern insrc/main/java/org/finos/calm/resources/SearchResource.java.Type of Change
Affected Components
cli/)calm/)calm-ai/)calm-hub/)calm-hub-ui/)calm-server/)calm-widgets/)docs/)shared/)calm-plugins/vscode/)Commit Message Format ✅
Testing
Checklist