Add supportsReadOnlyMode to ContentPropertyDisplay.cs

This commit is contained in:
Zeegaan
2022-06-22 11:31:58 +02:00
parent 7789f86b72
commit c552008870
3 changed files with 9 additions and 1 deletions

View File

@@ -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() };
}
}

View File

@@ -117,6 +117,8 @@ public class MemberTabsAndPropertiesMapper : TabsAndPropertiesMapper<IMember>
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<IMember>
View = "boolean",
IsSensitive = true,
Readonly = false,
SupportsReadOnly = true,
},
new()
@@ -243,6 +246,7 @@ public class MemberTabsAndPropertiesMapper : TabsAndPropertiesMapper<IMember>
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<IMember>
property.Value = null;
property.View = "sensitivevalue";
property.Readonly = true;
property.SupportsReadOnly = true;
}
}
}