Skip to content

server: introduce USE_SHARE for reading other users' shares - #118

Merged
littlegrasscao merged 2 commits into
mainfrom
server/split2/11b-use-share
Oct 21, 2026
Merged

littlegrasscao merged 2 commits into
mainfrom
server/split2/11b-use-share

Conversation

@littlegrasscao

@littlegrasscao littlegrasscao commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • add the USE_SHARE privilege, checked through CatalogConnector#authorize like CREATE_SHARE
  • GET /shares lists every share for a caller with USE_SHARE, and only the caller's own shares otherwise; paging works the same either way
  • GET /shares/{share} and GET /shares/{share}/permissions need the caller to own the share or hold USE_SHARE; otherwise they return 403 PERMISSION_DENIED
    • the owner reads their own shares without a catalog call
  • the local catalog gives each principal a privileges list and refuses privileges outside it; a principal without the list holds none
  • the sample local-catalog.yml lists CREATE_SHARE, CREATE_RECIPIENT and USE_SHARE for alice and bob, so earlier tests keep passing, and adds carol, who holds only CREATE_SHARE and CREATE_RECIPIENT

Testing

  • mvn clean install: 123 tests passed
  • ShareReadPrivilegeTest:
    • carol, without USE_SHARE, lists only her own share, while bob, who holds USE_SHARE, lists both alice's and carol's
    • carol can get her own share and its permissions, but gets 403 for alice's; bob can read carol's

@littlegrasscao
littlegrasscao force-pushed the server/split2/11b-use-share branch 4 times, most recently from 004c430 to c20222a Compare October 19, 2026 22:31
@littlegrasscao
littlegrasscao force-pushed the server/split2/11b-use-share branch 2 times, most recently from b71cd8c to 13e612a Compare October 21, 2026 17:01
Base automatically changed from server/split2/11a-provider-pagination to main October 21, 2026 18:51
@littlegrasscao
littlegrasscao force-pushed the server/split2/11b-use-share branch from 13e612a to a6f75ad Compare October 21, 2026 18:52
@littlegrasscao
littlegrasscao merged commit 204597c into main Oct 21, 2026
1 check passed
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.

2 participants