Skip to content

handle container access for folder only and container only - #941

Merged
SharonStrats merged 14 commits into
stagingfrom
fix/handle-multiaccess
Dec 2, 2026
Merged

SharonStrats merged 14 commits into
stagingfrom
fix/handle-multiaccess

Conversation

@SharonStrats

@SharonStrats SharonStrats commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Improve advanced access-control editing for containers while preserving independent
folder and contents permissions.

This update makes the access-control modal better reflect the underlying ACL
authorizations and avoids destructive revoke-then-grant behavior when changing
container scopes.

Changes

  • Group access grants by subject and effective folder/contents scope.
  • Display Mixed permissions when a subject has different roles across
    authorizations instead of incorrectly merging them.
  • Preserve independently governed folder and contents permissions.
  • Use planChangeContainerAccess for existing container scope changes so
    transitions are planned atomically.
  • Preserve conditions and unrelated authorization data during scope changes.
  • Support complementary folder and contents grants for the same subject in
    Advanced sharing.
  • Validate and reject overlapping container scopes before saving.
  • Prevent conflicting duplicate grants for the same subject.
  • Warn before leaving Advanced sharing when there are unsaved changes.
  • Allow users to stay, discard changes, or keep changes when switching modes.
  • Ignore delayed target lookups after the dialog is closed, discarded, or moved
    to another resource.

SharonStrats and others added 2 commits November 30, 2026 17:14
@SharonStrats SharonStrats self-assigned this Dec 1, 2026
Copilot AI balanced review requested due to automatic review settings December 1, 2026 07:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Access-change ordering and cancelled additions can incorrectly revoke existing permissions, and an existing test still expects the previous operation order.

2 open issues
What changed in this PR

This PR extends the access-control modal to manage separate permissions for a folder and its contents.

Changes:

  • Splits combined grants into independently editable folder and contents roles and validates overlapping scopes.
  • Updates grant ordering and scope-specific revocation, with tests for the new flows.
  • Adjusts shared-access controls for smaller screens.
File Description
test/​components/​access-control-modal.test.ts Adds tests for split grants, overlap validation, and folder-only revocation.
src/​components/​access-control-modal/​buildAccessChanges.ts Reorders pending grants and scope transitions.
src/​components/​access-control-modal/​applyAccessChanges.ts Uses folder-specific revocation for removals and scope changes.
src/​components/​access-control-modal/​AccessControlSharedAccess.ts Wraps scope controls for responsive layout.
src/​components/​access-control-modal/​AccessControlSharedAccess.styles.css Adds a mobile layout for shared-access rows.
src/​components/​access-control-modal/​AccessControlModal.ts Adds grant splitting, independent row identifiers, and overlap validation.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical access-control bugs can unexpectedly revoke permissions, discard complementary grants, and mislabel the subjects affected by edits.

5 open issues
2 resolved since last review

Review effort: Balanced

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Sequential ACL updates can corrupt permissions during scope swaps and revoke the caller’s only Control grant before a replacement owner is added, potentially leaving no controller.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

High severity Sequential PATCHes corrupt swapped folder and contents grants

src/​components/​access-control-modal/​applyAccessChanges.ts:35

Swapping a subject's folder=Viewer and contents=Editor scopes passes validation, but sequential PATCHes leave both grants on the folder and none on its contents. After the first move, the planner matches both contents authorizations for the second move, so Save can succeed with incorrect permissions. Plan both transitions from one original ACL snapshot while preserving conditions, or reject such swaps before any PATCH; add a regression using the real planner.

5 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The transition tests mock the planner, leaving preservation of conditions and other recipients’ permissions, plus scope-only changes to mixed-permission rows, unverified.

1 open issue
1 resolved since last review

Review effort: Balanced

@SharonStrats
SharonStrats force-pushed the fix/handle-multiaccess branch from ee2be28 to 7ee77d9 Compare December 2, 2026 02:47
@SharonStrats
SharonStrats merged commit cc2c502 into staging Dec 2, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in SolidOS NLNet UI Dec 2, 2026
@SharonStrats
SharonStrats deleted the fix/handle-multiaccess branch December 2, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Access Control: Needs to handle a user having multiple access on a container

3 participants