Skip to content

feat(social): enforce showcase ownership on updates (BA-056) - #1038

Open
ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/ba-056-showcase-ownership-969
Open

ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/ba-056-showcase-ownership-969

Conversation

@ranjeetprabhatedu-dotcom

Copy link
Copy Markdown

Summary

This PR addresses issue #969 (BA-056) by enforcing project ownership checks on showcase updates, allowing only authenticated project owners to modify showcase entries.

  • Changes:
    • BackendAcademy/src/social/showcase.service.ts: Added update method enforcing post.authorId === editorId with ForbiddenException for unauthorized callers and NotFoundException for missing showcases.
    • BackendAcademy/src/social/social.controller.ts: Added PUT and PATCH routes for showcase updates extracting author/editor identity.
    • BackendAcademy/src/social/showcase.service.spec.ts: Added comprehensive unit test coverage verifying owner edits, non-owner rejections (ForbiddenException), missing showcase rejection (NotFoundException), and updated URL validations.
  • Verification:
    • All 18 tests in showcase.service.spec.ts pass cleanly (100% Green).
    • Scope strictly restricted to the 3 allowlisted files.

Closes #969

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.

BA-056 — Enforce showcase ownership on updates

1 participant