Search Results for

    Show / Hide Table of Contents
    View Source

    Class UmbracoRequestPaths

    Utility for checking paths

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Routing
    Assembly: Umbraco.Core.dll
    Syntax
    public class UmbracoRequestPaths

    Constructors

    View Source

    UmbracoRequestPaths(IOptions<GlobalSettings>, IHostingEnvironment)

    Initializes a new instance of the UmbracoRequestPaths class.

    Declaration
    public UmbracoRequestPaths(IOptions<GlobalSettings> globalSettings, IHostingEnvironment hostingEnvironment)
    Parameters
    Type Name Description
    IOptions<GlobalSettings> globalSettings
    IHostingEnvironment hostingEnvironment

    Methods

    View Source

    IsBackOfficeRequest(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

    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.

    View Source

    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
    View Source

    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
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • UmbracoRequestPaths(IOptions<GlobalSettings>, IHostingEnvironment)
    • Methods
      • IsBackOfficeRequest(String)
      • IsClientSideRequest(String)
      • IsInstallerRequest(String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX