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

   ### What changes were proposed in this PR?
   
   Workflows took the owner's privilege from their `workflow_user_access` row 
alone. If that row was missing or downgraded, the owner lost access to their 
own workflow, or it was hidden from them. This makes workflows match datasets, 
models and computing units (#8890): the owner is always WRITE.
   
   - **Access checks**: `WorkflowAccessResource.getPrivilege` returns WRITE for 
the owner (via `OwnerAccess.privilege`) before reading the access row. 
`hasReadAccess`, `hasWriteAccess`, `hasGrantedAccess` and sharing all go 
through it.
   - **Search and the workflow list**: these include owned workflows, not only 
ones with an access row, and report the owner as WRITE.
   - **Owned-or-granted ids**: the new 
`WorkflowAccessResource.accessibleWids(uid)` is the single source for the ID 
and owner filters, the quota page and the admin executions page. Each of these 
used to read the access table alone.
   - **Hub**: `baseWorkflowSelect(uid)` joins only the viewer's access row, the 
same as the dataset/model hub fix in #8890. A workflow shared with several 
users now gives one card with the viewer's own level, instead of duplicates or 
someone else's level.
   
   ### Any related issues, documentation, discussions?
   
   Closes #9150. Follow-up to #8890.
   
   ### How was this PR tested?
   
   New tests:
   - `WorkflowAccessResourceSpec`: the owner is WRITE with no access row, and 
with a READ row. `accessibleWids` lists owned and granted workflows once each.
   - `WorkflowResourceSpec`: after the owner's access row is deleted, they 
still see the workflow as WRITE in the list, search, the ID and owner filters, 
and when opening it.
   - `HubResourceSpec`: a workflow shared with two other users gives one entry 
with the viewer's own level (NONE for an ungranted or anonymous viewer). The 
owner without an access row gets WRITE.
   - `WorkflowSearchQueryBuilderSpec`: the owner is WRITE whatever their access 
row says.
   
   Three existing tests assumed the old behaviour and were updated. One 
asserted NONE for an owner without an access row, which is the bug this PR 
fixes. The other two read the privilege as the owner, so they now read it as a 
non-owner.
   
   With the main-code changes reverted, the 6 new owner and hub tests fail. The 
affected specs pass (265/265), and `scalafmtCheckAll` and `scalafixAll --check` 
are clean.
   
   ### 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]

Reply via email to