Created UmbracoAuthorizeAttribute, UmbracoAuthorizedController for all base MVC controllers that required a back office user to be logged in.

Converted over the SaveTemplate and SavePartialView methods of the codeEditorSave legacy web service to use MVC services and marked them obsolete.
Created a generic route to route all controllers found in the namespace Umbraco.Web.WebServices. Added a 'Url' property on the BasePage webforms class
to expose a UrlHelper for use in views. Created UrlHelper extensions to easily get the base url path of the REST MVC web services.
Converted the EditView page and JavaScript to use the new REST services with jQuery instead of crappy MS ajax.
This commit is contained in:
Shannon Deminick
2012-12-30 03:11:21 +03:00
parent dbe9c6a2a9
commit a7834b45da
17 changed files with 446 additions and 72 deletions

View File

@@ -32,6 +32,7 @@ namespace Umbraco.Web
public WebBootManager(UmbracoApplication umbracoApplication)
: this(umbracoApplication, false)
{
}
/// <summary>
@@ -158,6 +159,16 @@ namespace Umbraco.Web
);
installPackageRoute.DataTokens.Add("area", umbracoPath);
//Create the REST/web/script service routes
var webServiceRoutes = RouteTable.Routes.MapRoute(
"Umbraco_web_services",
"Umbraco/RestServices/{controller}/{action}/{id}",
new {controller = "SaveFileController", action = "Index", id = UrlParameter.Optional},
//VERY IMPORTANT! for this route, only match controllers in this namespace!
new string[] { "Umbraco.Web.WebServices" }
);
webServiceRoutes.DataTokens.Add("area", umbracoPath);
//we need to find the surface controllers and route them
var surfaceControllers = SurfaceControllerResolver.Current.RegisteredSurfaceControllers.ToArray();