Restored type check for NuCache status controller.
Added service located extension method for retrieving creator and writer name.
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
|
||||
<_Parameter1>Umbraco.Web</_Parameter1>
|
||||
</AssemblyAttribute>
|
||||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
|
||||
<_Parameter1>Umbraco.Tests</_Parameter1>
|
||||
</AssemblyAttribute>
|
||||
|
||||
@@ -21,12 +21,10 @@ namespace Umbraco.Web.Editors
|
||||
{
|
||||
get
|
||||
{
|
||||
// TODO: do we need this?
|
||||
//var svc = _publishedSnapshotService as PublishedSnapshotService;
|
||||
//if (svc == null)
|
||||
// throw new NotSupportedException("Not running NuCache.");
|
||||
// return svc;
|
||||
return _publishedSnapshotService;
|
||||
var svc = _publishedSnapshotService as PublishedSnapshotService;
|
||||
if (svc == null)
|
||||
throw new NotSupportedException("Not running NuCache.");
|
||||
return svc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Umbraco.Web
|
||||
private static UmbracoContext UmbracoContext => Current.UmbracoContext;
|
||||
private static ISiteDomainHelper SiteDomainHelper => Current.Factory.GetInstance<ISiteDomainHelper>();
|
||||
private static IVariationContextAccessor VariationContextAccessor => Current.VariationContextAccessor;
|
||||
private static IUserService UserService => Current.Services.UserService;
|
||||
|
||||
#region IsComposedOf
|
||||
|
||||
@@ -795,6 +796,20 @@ namespace Umbraco.Web
|
||||
|
||||
#endregion
|
||||
|
||||
#region Writer and creator
|
||||
|
||||
public static string CreatorName(this IPublishedContent content)
|
||||
{
|
||||
return content.GetCreatorName(UserService);
|
||||
}
|
||||
|
||||
public static string WriterName(this IPublishedContent content)
|
||||
{
|
||||
return content.GetWriterName(UserService);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Url
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user