The GitHub Actions job "Required Checks" on texera.git/main has succeeded.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
bc4f3c877082e5af172dec006c5ba316afb0450b / Tanishq Gandhi 
<[email protected]>
fix(resource, computing-unit): keep owners' full access to their datasets, 
models and computing units (#8890)

### What changes were proposed in this PR?

Datasets, models and computing units each record their owner, plus a
separate access list. Two problems:

Any WRITE collaborator could change or remove the owner’s own access
entry.
Several places decided what a user sees from the access list alone, so a
changed or missing entry hid the resource from its owner or gave them
read-only controls.

This PR:

1. Refuses to change or revoke the owner’s access (403, the same message
workflows use), for datasets, models and computing units.
2. Treats the owner as WRITE wherever access is read, whatever their
access entry says:

- ResourceAccess.privilegeOf, used by the dataset and model detail
pages.

- listVisible (Datasets and Models lists) and ownerEmailsVisibleTo
(owner filter).

- Unified search: its filter and VersionedResourceTables.hydrate.

- getComputingUnitInfo. A planted READ row could disable Run for the
owner.

- Hub and search cards: `entryLink` sends the owner to the private page
even without an access row.

Owners whose entry was already damaged are fixed by this, with no
migration.

3. Hides a leftover owner row from the computing-unit access list, and
refuses that list (403) to a user who can't see the unit.
4. Hub top cards (`fetchDashboardVersionedResourcesByIds`) now carry
only the viewer's own privilege, not another user's.

The owner rule and the "can't change the owner" guard live in one
helper, `OwnerAccess` in `common/auth`; its `granted` argument is
by-name, so the owner skips the access-row query.

Workflows are out of scope: their sharing already refuses to change the
owner's row, and moving their read paths to the same owner rule is
tracked in #9150.

Before: a WRITE collaborator shares the dataset with the owner as READ,
and the owner loses the Settings tab, delete button and upload panel:

<img width="1440" height="900" alt="before-2-collab-shares-owner-read"
src="https://github.com/user-attachments/assets/73d09dde-0f5d-47ed-87a5-28de28f47869";
/>

<img width="1440" height="900" alt="before-4-owner-after"
src="https://github.com/user-attachments/assets/e6c17268-d3dd-48fe-b181-d473051b14d9";
/>

After: the same share is refused, and the owner's page is unchanged:

<img width="1440" height="900" alt="after-1-share-refused"
src="https://github.com/user-attachments/assets/1989748e-e285-4d9d-b46b-2608817e88bb";
/>

<img width="1440" height="900" alt="after-2-owner-keeps-access"
src="https://github.com/user-attachments/assets/b5df49da-fc62-4366-bfa1-d03597a450fc";
/>


### Any related issues, documentation, discussions?
Closes #8889


### How was this PR tested?
New ResourceAccessSpec in common/resource, covering the owner’s
privilege, lists, owner filter, and the grant/revoke guard. The module
gets DAO % "test->test" and a test-only jersey-common dependency for
this.
New `OwnerAccessSpec` in `common/auth`, and new cases in
DatasetSearchQueryBuilderSpec, HubResourceSpec,
ComputingUnitAccessResourceSpec, ComputingUnitManagingResourceSpec and
the frontend `resource-registry.service.spec.ts`.
All new tests fail without the change.
DatasetResourceSpec’s orphan-dataset test now uses another user’s public
dataset, so it still exercises the public-list path.

```
sbt "Auth/testOnly *OwnerAccessSpec" "Resource/test" \
    "ComputingUnitManagingService/testOnly *ComputingUnitAccessResourceSpec 
*ComputingUnitManagingResourceSpec" \
    "FileService/testOnly *DatasetAccessResourceSpec *ModelAccessResourceSpec 
*DatasetResourceSpec" \
    "WorkflowExecutionService/testOnly *DatasetSearchQueryBuilderSpec 
*HubResourceSpec"
cd frontend && yarn ng test --watch=false 
--include='**/resource-registry.service.spec.ts'
```
Also checked against a local stack: sharing a dataset with its owner as
READ is refused, and DELETE
/api/access/dataset/revoke/{did}/{ownerEmail} returns 403.

### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)

Report URL: https://github.com/apache/texera/actions/runs/40437496408

With regards,
GitHub Actions via GitBox

Reply via email to