Class UmbracoRequestPaths
Utility for checking paths
Inheritance
Namespace: Umbraco.Cms.Core.Routing
Assembly: Umbraco.Core.dll
Syntax
public class UmbracoRequestPaths
Constructors
View SourceUmbracoRequestPaths(IOptions<GlobalSettings>, IHostingEnvironment)
Declaration
public UmbracoRequestPaths(IOptions<GlobalSettings> globalSettings, IHostingEnvironment hostingEnvironment)
Parameters
Type | Name | Description |
---|---|---|
IOptions<GlobalSettings> | globalSettings | |
IHostingEnvironment | hostingEnvironment |
UmbracoRequestPaths(IOptions<GlobalSettings>, IHostingEnvironment, IOptions<UmbracoRequestPathsOptions>)
Initializes a new instance of the UmbracoRequestPaths class.
Declaration
public UmbracoRequestPaths(IOptions<GlobalSettings> globalSettings, IHostingEnvironment hostingEnvironment, IOptions<UmbracoRequestPathsOptions> umbracoRequestPathsOptions)
Parameters
Type | Name | Description |
---|---|---|
IOptions<GlobalSettings> | globalSettings | |
IHostingEnvironment | hostingEnvironment | |
IOptions<UmbracoRequestPathsOptions> | umbracoRequestPathsOptions |
Methods
View SourceIsBackOfficeRequest(String)
Checks if the current uri is a back office request
Declaration
public bool IsBackOfficeRequest(string absPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | absPath |
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
There are some special routes we need to check to properly determine this:
These are def back office: /Umbraco/BackOffice = back office /Umbraco/Preview = back office /Umbraco/Management/Api = back office
If it's not any of the above then we cannot determine if it's back office or front-end so we can only assume that it is not back office. This will occur if people use an UmbracoApiController for the backoffice but do not inherit from UmbracoAuthorizedApiController and do not use [IsBackOffice] attribute.
These are def front-end: /Umbraco/Surface = front-end /Umbraco/Api = front-end But if we've got this far we'll just have to assume it's front-end anyways.
IsClientSideRequest(String)
Rudimentary check to see if it's not a server side request
Declaration
public bool IsClientSideRequest(string absPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | absPath |
Returns
Type | Description |
---|---|
System.Boolean |
IsInstallerRequest(String)
Checks if the current uri is an install request
Declaration
public bool IsInstallerRequest(string absPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | absPath |
Returns
Type | Description |
---|---|
System.Boolean |