Skip to content

Require view permission for the project events history query - #32

Merged
johardi merged 1 commit into
epic/303-ssefrom
feat/295-view-permission
Jul 27, 2026
Merged

Require view permission for the project events history query#32
johardi merged 1 commit into
epic/303-ssefrom
feat/295-view-permission

Conversation

@johardi

@johardi johardi commented Jul 25, 2026

Copy link
Copy Markdown
Member

The service half of protegeproject/webprotege-gwt-ui#295 (part of protegeproject/webprotege-gwt-ui#303).

The pull-path handler implemented the plain CommandHandler type, so any logged-in user could fetch the full change history of any project by supplying its id. It now implements AuthorizedCommandHandler requiring the ViewProject capability on the project resource — the same check the WebSocket subscribe path performs, so the two paths cannot disagree. A null project id is rejected as a bad request, and a contract test pins the resource + capability.

Notes for review:

  • webprotege-authorization is pinned to 2.0.1 directly: Maven mediation resolved 0.9.3 (via backend-api), which lacks the Capability classes the authorized handler needs. Verified: backend-api references no authorization types, and ProjectResource is identical between versions.
  • The unused BuiltInAction enum was built on 0.9.3's removed ActionId API and is deleted with the bump (dead code, zero references).
  • Pre-existing, out of scope: the ipc authorization wrapper forwards only the FIRST required capability, and tests need JDK 17 (Mockito in the existing suite cannot mock concrete classes on newer JDKs).
  • The companion gwt-ui fix (stop logging the access token on the 403 path) is Stop logging the user's access token on the permission-denied dispatch path webprotege-gwt-ui#310.

The handler answering the project-events pull query implemented the plain
CommandHandler type, so any logged-in user could fetch the full change
history of any project just by supplying its id. The WebSocket subscribe
path already required the ViewProject capability; the pull path now goes
through AuthorizedCommandHandler with the same capability on the same
project resource, so the two paths cannot disagree.

A null project id is rejected as a bad request instead of blowing up
inside the authorization wrapper, and a contract test pins the resource
and capability so a refactor cannot silently drop the check.

The webprotege-authorization dependency is pinned to 2.0.1 directly:
Maven mediation previously resolved 0.9.3 (via backend-api), which lacks
the Capability classes the authorized handler needs. The unused
BuiltInAction enum was built on 0.9.3's removed ActionId API and is
deleted with the bump.

Fixes the service half of protegeproject/webprotege-gwt-ui#295
(part of protegeproject/webprotege-gwt-ui#303).
@johardi
johardi merged commit 98241ed into epic/303-sse Jul 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant