Block permissions: Correction of read-only inheritance and language access (closes #22472, #21973)#22522
Block permissions: Correction of read-only inheritance and language access (closes #22472, #21973)#22522nielslyngsoe merged 104 commits intorelease/17.4.0from
Conversation
|
Claude finished @nielslyngsoe's task in 1m 52s —— View job PR ReviewTarget: Reverts the readonly state propagation from the block workspace to child content/settings 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 ApprovedThis looks good to be merged as-is, but please do a manual sanity check and testing before merging. |
There was a problem hiding this comment.
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
readOnlyGuardonly.
|
Claude finished @nielslyngsoe's task in 10m 52s —— View job PR ReviewTarget: Reverts the block-workspace
Important
Suggestions
Approved with Suggestions for improvementGood to go, but please carefully consider the importance of the suggestions. |
|
Test cases for verification:
|
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>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
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).