mengw15 opened a new pull request, #7222:
URL: https://github.com/apache/texera/pull/7222

   ### What changes were proposed in this PR?
   
   Extends the existing `MockTexeraDB`-backed `ProjectAccessResourceSpec` to 
cover
   the read/query and grant/revoke endpoints
   
(`amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/project/ProjectAccessResource.scala`).
   The prior spec only exercised `getProjectAccessPrivilege` / 
`userHasWriteAccess`
   for the owner/READ/NONE cases. No production code was changed.
   
   A third seeded user (a WRITE grantee) is added; +8 tests cover:
   
   - `getProjectAccessPrivilege` / `userHasWriteAccess` — the WRITE-grantee case
     (a non-owner with WRITE), which the existing tests didn't reach.
   - `getOwner` — returns the owning user's email.
   - `getAccessList` — empty when only the owner has access (the owner is 
excluded),
     and lists every grantee with their email, name and privilege (READ and 
WRITE).
   - `grantAccess` — a writer grants READ to another user (access row created), 
and a
     user without write access is rejected with `ForbiddenException`.
   - `revokeAccess` — a grantee's access is removed, and a user without write 
access
     is rejected with `ForbiddenException`.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7178
   
   ### How was this PR tested?
   
   Extended unit tests, run locally against embedded Postgres (`MockTexeraDB`). 
All
   pass, and the failure path was verified by breaking an assertion to confirm 
the
   suite goes red:
   
   ```
   sbt "WorkflowExecutionService/testOnly *ProjectAccessResourceSpec"
   # Tests: succeeded 11, failed 0
   sbt "WorkflowExecutionService/Test/scalafmtCheck"       # clean
   sbt "WorkflowExecutionService/Test/scalafix --check"    # clean
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8 [1M context])
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to