Skip to content

fix(calm-hub): Adding permission filtering to GET:/namespaces endpoin…#2639

Draft
ConfuddledPenguin wants to merge 1 commit into
finos:mainfrom
ConfuddledPenguin:feature/list-namespace-permissions
Draft

fix(calm-hub): Adding permission filtering to GET:/namespaces endpoin…#2639
ConfuddledPenguin wants to merge 1 commit into
finos:mainfrom
ConfuddledPenguin:feature/list-namespace-permissions

Conversation

@ConfuddledPenguin

@ConfuddledPenguin ConfuddledPenguin commented Jun 14, 2026

Copy link
Copy Markdown

…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:/namespaces endpoint 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 in src/main/java/org/finos/calm/resources/SearchResource.java.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/formatting changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements
  • ✅ Test additions or updates
  • 🔧 Chore (maintenance, dependencies, CI, etc.)

Affected Components

  • CLI (cli/)
  • Schema (calm/)
  • CALM AI (calm-ai/)
  • CALM Hub (calm-hub/)
  • CALM Hub UI (calm-hub-ui/)
  • CALM Server (calm-server/)
  • CALM Widgets (calm-widgets/)
  • Documentation (docs/)
  • Shared (shared/)
  • VS Code Extension (calm-plugins/vscode/)
  • Dependencies
  • CI/CD

Commit Message Format ✅

Testing

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 14, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: ConfuddledPenguin / name: = (e30fc1f)

@github-actions github-actions Bot added the calm-hub Affects `calm-hub` label Jun 14, 2026
@ConfuddledPenguin ConfuddledPenguin force-pushed the feature/list-namespace-permissions branch 2 times, most recently from 1486b99 to 7324a7f Compare June 14, 2026 20:52
@markscott-ms

Copy link
Copy Markdown
Contributor

@ConfuddledPenguin this may require minor coordination with #2640 due to that PR introducing NamespaceService for NamespaceResource to use, to abstract some UserStore related usage away from the resource layer.

Set<String> grants = userAccessValidatorInstance.get()
.getReadableNamespaces(identity.getPrincipal().getName());
return new ValueWrapper<>(namespaceStore.getNamespaces().stream()
.filter(ns -> grants.contains(ns.getName()))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@ConfuddledPenguin ConfuddledPenguin force-pushed the feature/list-namespace-permissions branch from 7324a7f to e30fc1f Compare June 15, 2026 17:39
@jpgough-ms

Copy link
Copy Markdown
Member

Looks like a few conflicts and a few things to updated. Thanks @ConfuddledPenguin for the work so far

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

calm-hub Affects `calm-hub`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants