Revert "Fixes: U4-4211 User without media section permission will be logged out immediately when accessing a document type using a media picker datatype (u7.0.3) - this is done by using the entityResource in the mediaPicker but to do this we need to return a cut down version of the media properties in the additionalData which is tricky because the cropper stores json which is ntext and the existing sql didn't cater for this. This also cleans up the entity service and we no longer have this internal collection of properties, everything is just added to additionalData, then had to add mediaHelper method to deal with getting urls from a media 'entity' not just a media object."
This reverts commit c38c2ede11.
This commit is contained in:
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
@@ -48,11 +47,13 @@ namespace Umbraco.Core.Models
|
||||
public UmbracoEntity()
|
||||
{
|
||||
AdditionalData = new Dictionary<string, object>();
|
||||
UmbracoProperties = new List<UmbracoProperty>();
|
||||
}
|
||||
|
||||
public UmbracoEntity(bool trashed)
|
||||
{
|
||||
AdditionalData = new Dictionary<string, object>();
|
||||
UmbracoProperties = new List<UmbracoProperty>();
|
||||
Trashed = trashed;
|
||||
}
|
||||
|
||||
@@ -60,6 +61,7 @@ namespace Umbraco.Core.Models
|
||||
public UmbracoEntity(UInt64 trashed)
|
||||
{
|
||||
AdditionalData = new Dictionary<string, object>();
|
||||
UmbracoProperties = new List<UmbracoProperty>();
|
||||
Trashed = trashed == 1;
|
||||
}
|
||||
|
||||
@@ -285,31 +287,15 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
}
|
||||
|
||||
public override object DeepClone()
|
||||
{
|
||||
var clone = (UmbracoEntity) base.DeepClone();
|
||||
|
||||
//This ensures that any value in the dictionary that is deep cloneable is cloned too
|
||||
foreach (var key in clone.AdditionalData.Keys.ToArray())
|
||||
{
|
||||
var deepCloneable = clone.AdditionalData[key] as IDeepCloneable;
|
||||
if (deepCloneable != null)
|
||||
{
|
||||
clone.AdditionalData[key] = deepCloneable.DeepClone();
|
||||
}
|
||||
}
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A struction that can be contained in the additional data of an UmbracoEntity representing
|
||||
/// a user defined property
|
||||
/// Some entities may expose additional data that other's might not, this custom data will be available in this collection
|
||||
/// </summary>
|
||||
public class EntityProperty : IDeepCloneable
|
||||
public IList<UmbracoProperty> UmbracoProperties { get; set; }
|
||||
|
||||
internal class UmbracoProperty : IDeepCloneable
|
||||
{
|
||||
public string PropertyEditorAlias { get; set; }
|
||||
public object Value { get; set; }
|
||||
public string Value { get; set; }
|
||||
public object DeepClone()
|
||||
{
|
||||
//Memberwise clone on Entity will work since it doesn't have any deep elements
|
||||
@@ -318,7 +304,7 @@ namespace Umbraco.Core.Models
|
||||
return clone;
|
||||
}
|
||||
|
||||
protected bool Equals(EntityProperty other)
|
||||
protected bool Equals(UmbracoProperty other)
|
||||
{
|
||||
return PropertyEditorAlias.Equals(other.PropertyEditorAlias) && string.Equals(Value, other.Value);
|
||||
}
|
||||
@@ -328,7 +314,7 @@ namespace Umbraco.Core.Models
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((EntityProperty) obj);
|
||||
return Equals((UmbracoProperty) obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
|
||||
Reference in New Issue
Block a user