diff --git a/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs index 2bd69d78b4..d977f59a3d 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs @@ -18,7 +18,7 @@ namespace Umbraco.Core.Configuration.Dashboard protected override object GetElementKey(ConfigurationElement element) { - return ((ControlElement)element).Value; + return ((ControlElement)element).ControlPath; } IEnumerator IEnumerable.GetEnumerator() diff --git a/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs b/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs index 778882f1b2..0a3ef8bc78 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs @@ -1,8 +1,10 @@ using System.Configuration; +using System.Linq; +using System.Xml.Linq; namespace Umbraco.Core.Configuration.Dashboard { - internal class ControlElement : InnerTextConfigurationElement, IControl + internal class ControlElement : RawXmlConfigurationElement, IControl { [ConfigurationProperty("showOnce", DefaultValue = false)] public bool ShowOnce @@ -22,9 +24,24 @@ namespace Umbraco.Core.Configuration.Dashboard get { return (string)this["panelCaption"]; } } + [ConfigurationProperty("access")] + public AccessElement Access + { + get { return (AccessElement)this["access"]; } + } + public string ControlPath { - get { return Value; } + get + { + //we need to return the first (and only) text element of the children (wtf... who designed this configuration ! :P ) + var txt = RawXml.Nodes().OfType().FirstOrDefault(); + if (txt == null) + { + throw new ConfigurationErrorsException("The control element must contain a text node indicating the control path"); + } + return txt.Value; + } } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/Dashboard/ISection.cs b/src/Umbraco.Core/Configuration/Dashboard/ISection.cs index cf8a802d12..a5765b6107 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/ISection.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/ISection.cs @@ -9,5 +9,7 @@ namespace Umbraco.Core.Configuration.Dashboard string Area { get; } IEnumerable Tabs { get; } + + IAccess AccessRights { get; } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs b/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs index db20fad4e5..de83353722 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs @@ -16,6 +16,12 @@ namespace Umbraco.Core.Configuration.Dashboard { get { return (AreasElement)this["areas"]; } } + + [ConfigurationProperty("access")] + public AccessElement Access + { + get { return (AccessElement)this["access"]; } + } [ConfigurationCollection(typeof(SectionCollection), AddItemName = "tab")] [ConfigurationProperty("", IsDefaultCollection = true)] @@ -34,5 +40,10 @@ namespace Umbraco.Core.Configuration.Dashboard { get { return Area.AreaName; } } + + IAccess ISection.AccessRights + { + get { return Access; } + } } } \ No newline at end of file