aglinxinyuan opened a new pull request, #9391: URL: https://github.com/apache/texera/pull/9391
### What changes were proposed in this PR? `DatasetAccessResourceSpec` and `ModelAccessResourceSpec` repeated the same 36 cases line for line; only the resource noun, the helper names, the access table and the seed rows differed. A new abstract suite, `AccessResourceBehaviors`, registers the cases once. Each spec now seeds its own resource and binds the cases to its own helpers (`isDatasetPublic`, `getModelUserAccessPrivilege`, ...) and endpoints, so both APIs stay covered case by case. Explicit grants are seeded, read and cleared through the existing `ResourceTables` descriptors. | Surface | Pinned | | --- | --- | | privilege helpers | public flag, ownership, explicit privilege, read and write access, owner lookup, nonexistent ids | | `grantAccess` | grant, placeholder rejection, re-grant, sharing by a WRITE grantee, owner protection, forbidden callers | | `getAccessList` | empty list, owner row hidden, several grantees, read guard | | `revokeAccess` | revoke, revoking by a WRITE grantee, no-op, owner protection, forbidden callers | | owner email endpoint | owner, READ grantee, private, public and nonexistent resources | Test names, order and outcomes are unchanged: 36 dataset cases and 37 model cases. The model-only unknown-email case keeps its place after the placeholder case. ### Any related issues, documentation, discussions? Closes #9390. ### How was this PR tested? - `sbt "FileService/testOnly org.apache.texera.service.resource.DatasetAccessResourceSpec org.apache.texera.service.resource.ModelAccessResourceSpec"`: the 73 tests pass on main and on this branch, with the same names in the same order, compared case by case from the JUnit XML reports. - Mutation check: binding the dataset spec's write-access helper to the read helper fails two of its cases, and granting to an existing email in the model-only case fails that case; every other case passes. - `sbt "FileService/Test/scalafmtCheck" "FileService/Test/scalafix --check"` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) -- 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]
