From c5520088702cdd5a86daef692659c75d1322876b Mon Sep 17 00:00:00 2001 From: Zeegaan Date: Wed, 22 Jun 2022 11:31:58 +0200 Subject: [PATCH] Add supportsReadOnlyMode to ContentPropertyDisplay.cs --- .../Models/ContentEditing/ContentPropertyDisplay.cs | 3 +++ src/Umbraco.Core/Models/Mapping/ContentVariantMapper.cs | 2 +- .../Models/Mapping/MemberTabsAndPropertiesMapper.cs | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Models/ContentEditing/ContentPropertyDisplay.cs b/src/Umbraco.Core/Models/ContentEditing/ContentPropertyDisplay.cs index ca8c2f1fc2..5ca8a7ad86 100644 --- a/src/Umbraco.Core/Models/ContentEditing/ContentPropertyDisplay.cs +++ b/src/Umbraco.Core/Models/ContentEditing/ContentPropertyDisplay.cs @@ -40,4 +40,7 @@ public class ContentPropertyDisplay : ContentPropertyBasic [DataMember(Name = "readonly")] public bool Readonly { get; set; } + + [DataMember(Name = "supportsReadOnly")] + public bool SupportsReadOnly { get; set; } } diff --git a/src/Umbraco.Core/Models/Mapping/ContentVariantMapper.cs b/src/Umbraco.Core/Models/Mapping/ContentVariantMapper.cs index d909ef9c91..e1f855c647 100644 --- a/src/Umbraco.Core/Models/Mapping/ContentVariantMapper.cs +++ b/src/Umbraco.Core/Models/Mapping/ContentVariantMapper.cs @@ -252,7 +252,7 @@ public class ContentVariantMapper // If user does not have access, return only browse permission if (!hasAccess) { - return new[] {ActionBrowse.ActionLetter.ToString()}; + return new[] { ActionBrowse.ActionLetter.ToString() }; } } diff --git a/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs b/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs index ae9876628f..6b0556d455 100644 --- a/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs +++ b/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs @@ -117,6 +117,8 @@ public class MemberTabsAndPropertiesMapper : TabsAndPropertiesMapper prop.IsSensitive = true; // mark this property as readonly so that it does not post any data prop.Readonly = true; + // this is readonly so support read-only mode + prop.SupportsReadOnly = true; // replace this editor with a sensitive value prop.View = "sensitivevalue"; // clear the value @@ -233,6 +235,7 @@ public class MemberTabsAndPropertiesMapper : TabsAndPropertiesMapper View = "boolean", IsSensitive = true, Readonly = false, + SupportsReadOnly = true, }, new() @@ -243,6 +246,7 @@ public class MemberTabsAndPropertiesMapper : TabsAndPropertiesMapper View = "boolean", IsSensitive = true, Readonly = !member.IsLockedOut, // IMember.IsLockedOut can't be set to true, so make it readonly when that's the case (you can only unlock) + SupportsReadOnly = true, }, new() @@ -283,6 +287,7 @@ public class MemberTabsAndPropertiesMapper : TabsAndPropertiesMapper property.Value = null; property.View = "sensitivevalue"; property.Readonly = true; + property.SupportsReadOnly = true; } } }