Skip to content

Block permissions: Correction of read-only inheritance and language access (closes #22472, #21973)#22522

Merged
nielslyngsoe merged 104 commits intorelease/17.4.0from
v17/hotfix/22472
May 4, 2026
Merged

Block permissions: Correction of read-only inheritance and language access (closes #22472, #21973)#22522
nielslyngsoe merged 104 commits intorelease/17.4.0from
v17/hotfix/22472

Conversation

@nielslyngsoe
Copy link
Copy Markdown
Member

@nielslyngsoe nielslyngsoe commented Apr 17, 2026

Fixes: #22472
Fixes: #21973

Revert parts of #21982

This makes the Block Workspace no longer directly inherit permissions via the Block Manager; instead, it sets up language access similar to how the Document Workspace does it. — This aligns with how permissions will work from v.19, in relation to local/global blocks.

The above implementation incorporates a custom block manager inheritance in the case of an invariant block; invariant blocks are not covered by the system language access but have to inherit the access from the property it belongs to.

Extension Initializers have been adjusted to correct fast shifting conditions, which lead to a race condition with an unreliable result. Now extensions are reacting according to conditions.

Additionally, Block Workspace got a read-only badge for clearer communication, and acceptance tests have been corrected for the updated header.

Blocks can still be viewed in read-only mode, so users can always click on edit or settings to 'read' the data, despite being in read-only mode. — This is the general UX of read-only mode, so just aligning with the general approach.

Test Notes:

Assuming languages are English(Default) and Danish(not default)

For all cases, the Document varies by culture.

Single-level cases:

Setup:
AllowEditInvariantFromNonDefault: false
Property Vary-by-culture
Block List Editor
Block with Element:
Element Varies By Culture.
— Property that varies by culture.
— Property that does not vary by culture(shared).

Check that the not vary-by-culture(shared) property of a Block can be edited on a non-default language(Danish).

Setup:
AllowEditInvariantFromNonDefault: false
Property Not Vary-By-Culture (Shared/Block Level Variants)
Block List Editor
Block with Element:
Element Varies By Culture.
— Property that varies by culture.
— Property that does not vary by culture(shared).

Check that the not vary-by-culture property of a Block can NOT be edited on a non-default language(Danish).

Setup:
AllowEditInvariantFromNonDefault: true
Property Vary-by-culture
Block List Editor
Block with Element:
Element Varies By Culture.
— Property that varies by culture.
— Property that does not vary by culture(shared).

Check that the not vary-by-culture(shared) property of a Block can be edited on a non-default language(Danish).



Setup:
AllowEditInvariantFromNonDefault: true
Property Not Vary-By-Culture (Shared/Block Level Variants)
Block List Editor
Block with Element:
Element Varies By Culture.
— Property that varies by culture.
— Property that does not vary by culture(shared).


Check that the not vary-by-culture property of a Block can be edited on a non-default language(Danish).

Double-level cases:

Setup:
AllowEditInvariantFromNonDefault: false
Property Vary-by-culture
Block List Editor
Block with Element:
Element Varies Not By Culture.
— Property that does not vary by culture(shared).
—— Containing a Block List Editor
—— Block with Element:
———Element Varies Not By Culture.
———— Property that does not vary by culture(shared).

Check that the Block inside the Block's not vary-by-culture(shared) property can be edited from a non-default language(Danish).

Setup:
AllowEditInvariantFromNonDefault: false
Property Not Vary-By-Culture (Shared/Block Level Variants)
Block List Editor
Block with Element:
Element Varies Not By Culture.
— Property that does not vary by culture(shared).
—— Containing a Block List Editor
—— Block with Element:
———Element Varies Not By Culture.
———— Property that does not vary by culture(shared).

Check that the Block inside the Block's not vary-by-culture(shared) property can NOT be edited from a non-default language(Danish).

Setup:
AllowEditInvariantFromNonDefault: false
Property Not Vary-By-Culture (Shared/Block Level Variants)
Block List Editor
Block with Element:
Element Varies By Culture.
— Property that does vary by culture(shared).
—— Containing a Block List Editor
—— Block with Element:
———Element Varies By Culture.
———— Property that does not vary by culture(shared).

Check that the Block inside the Block's not vary-by-culture(shared) property can NOT be edited from a non-default language(Danish).

@nielslyngsoe nielslyngsoe marked this pull request as ready for review April 17, 2026 18:13
Copilot AI review requested due to automatic review settings April 17, 2026 18:13
@claude
Copy link
Copy Markdown

claude Bot commented Apr 17, 2026

Claude finished @nielslyngsoe's task in 1m 52s —— View job


PR Review

Target: origin/main · Based on commit: 50c5d4ea

Reverts the readonly state propagation from the block workspace to child content/settings propertyWriteGuards, introduced in #21982. The workspace-level readOnlyGuard is preserved; only the per-property write guard inheritance is removed.


No critical, important, or suggestion findings — the diff is a clean, surgical removal of 4 lines that exactly matches the stated intent.

One thing worth noting: removing propertyWriteGuard propagation means individual properties in a read-only block's content/settings tab are no longer guarded at the property level. The workspace-level readOnlyGuard remains, but depending on how UI components consume these guards, there may be a window where individual properties appear editable even when the block is read-only. The PR description acknowledges this ("A proper solution will be investigated for a future version"), so this is an acceptable temporary state for a hotfix.


Approved

This looks good to be merged as-is, but please do a manual sanity check and testing before merging.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Hotfix PR that reverts part of the block-editor “read-only” propagation introduced in #21982, aiming to resolve the regression where blocks could not be edited in non-default languages under specific variance/permission configurations.

Changes:

  • Stops propagating block-manager read-only state into block workspace content/settings.propertyWriteGuard.
  • Keeps propagating read-only state into the workspace readOnlyGuard only.

@nielslyngsoe nielslyngsoe marked this pull request as draft April 21, 2026 11:49
@nielslyngsoe nielslyngsoe marked this pull request as ready for review April 22, 2026 20:34
@claude
Copy link
Copy Markdown

claude Bot commented Apr 22, 2026

Claude finished @nielslyngsoe's task in 10m 52s —— View job


PR Review

Target: origin/main · Based on commit: 5117e1ee · Skipped: 0 noise files out of 30 total

Reverts the block-workspace propertyWriteGuard propagation introduced in #21982 (the source of the read-only inheritance regression), adds a new variant-scoped language-access context for blocks, and fixes a race condition in the extension initializer (AbortController + pending-call deduplication). The extension initializer changes ship with a comprehensive race test suite.

  • Modified public API: UmbReadOnlyVariantGuardManager.isPermittedForObservableVariant return type widened to Observable<boolean | undefined>; UmbVariantId.INVARIANT static added; UmbBaseExtensionInitializer._conditionsAreGood signature now accepts AbortSignal
  • Other changes: Block entry components no longer hide edit/settings buttons when the block is in read-only mode (read-only state is now guarded at the workspace level instead); _conditionsAreBad() is now called synchronously in the conditions-negative branch

Important

  • base-extension-initializer.controller.ts:247: allConditionsHaveControllers validates by alias only — see inline comment. Fix this →

Suggestions

  • readonly-variant-guard.manager.ts:41: JSDoc @returns {Observable<boolean>} is stale; return type is now Observable<boolean | undefined> — see inline comment.
  • manifests.ts (block/workspace):13: SubmitCreate action is commented out with /* ... */ instead of being deleted — see inline comment.
  • block-workspace-is-readonly.condition.ts:19: this.config.match !== undefined ? args.config.match : truethis.config.match ?? true — see inline comment.
  • block-language-access.workspace.context.ts:9: Missing JSDoc on the exported class — see inline comment.

Approved with Suggestions for improvement

Good to go, but please carefully consider the importance of the suggestions.

@AndyButland
Copy link
Copy Markdown
Contributor

Test cases for verification:

nielslyngsoe and others added 7 commits May 1, 2026 08:37
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@nielslyngsoe nielslyngsoe enabled auto-merge (squash) May 1, 2026 08:06
@AndyButland AndyButland changed the title Block permissions: Correction of read-only inheritance and language access Block permissions: Correction of read-only inheritance and language access (closes #22472, #21973) May 4, 2026
@nielslyngsoe nielslyngsoe merged commit f2dc9e7 into release/17.4.0 May 4, 2026
25 of 26 checks passed
@nielslyngsoe nielslyngsoe deleted the v17/hotfix/22472 branch May 4, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot edit blocks on other languages when AllowEditInvariantFromNonDefault is false

6 participants