Search Results for

    Show / Hide Table of Contents
    View Source

    Class CurrentUserController

    Controller to back the User.Resource service, used for fetching user data when already authenticated. user.service is currently used for handling authentication

    Inheritance
    System.Object
    Microsoft.AspNetCore.Mvc.ControllerBase
    UmbracoApiControllerBase
    UmbracoApiController
    UmbracoAuthorizedApiController
    UmbracoAuthorizedJsonController
    Namespace: Umbraco.Cms.Web.BackOffice.Controllers
    Assembly: Umbraco.Web.BackOffice.dll
    Syntax
    [PluginController(null)]
    public class CurrentUserController : UmbracoAuthorizedJsonController, IUmbracoFeature, IDiscoverable

    Constructors

    View Source

    CurrentUserController(MediaFileManager, IOptions<ContentSettings>, IHostingEnvironment, IImageUrlGenerator, IBackOfficeSecurityAccessor, IUserService, IUmbracoMapper, IBackOfficeUserManager, ILoggerFactory, ILocalizedTextService, AppCaches, IShortStringHelper, IPasswordChanger<BackOfficeIdentityUser>)

    Declaration
    [Obsolete("This constructor is obsolete and will be removed in v11, use constructor with all values")]
    public CurrentUserController(MediaFileManager mediaFileManager, IOptions<ContentSettings> contentSettings, IHostingEnvironment hostingEnvironment, IImageUrlGenerator imageUrlGenerator, IBackOfficeSecurityAccessor backofficeSecurityAccessor, IUserService userService, IUmbracoMapper umbracoMapper, IBackOfficeUserManager backOfficeUserManager, ILoggerFactory loggerFactory, ILocalizedTextService localizedTextService, AppCaches appCaches, IShortStringHelper shortStringHelper, IPasswordChanger<BackOfficeIdentityUser> passwordChanger)
    Parameters
    Type Name Description
    MediaFileManager mediaFileManager
    Microsoft.Extensions.Options.IOptions<ContentSettings> contentSettings
    IHostingEnvironment hostingEnvironment
    IImageUrlGenerator imageUrlGenerator
    IBackOfficeSecurityAccessor backofficeSecurityAccessor
    IUserService userService
    IUmbracoMapper umbracoMapper
    IBackOfficeUserManager backOfficeUserManager
    Microsoft.Extensions.Logging.ILoggerFactory loggerFactory
    ILocalizedTextService localizedTextService
    AppCaches appCaches
    IShortStringHelper shortStringHelper
    IPasswordChanger<BackOfficeIdentityUser> passwordChanger
    View Source

    CurrentUserController(MediaFileManager, IOptions<ContentSettings>, IHostingEnvironment, IImageUrlGenerator, IBackOfficeSecurityAccessor, IUserService, IUmbracoMapper, IBackOfficeUserManager, ILocalizedTextService, AppCaches, IShortStringHelper, IPasswordChanger<BackOfficeIdentityUser>, IUserDataService)

    Declaration
    [ActivatorUtilitiesConstructor]
    public CurrentUserController(MediaFileManager mediaFileManager, IOptions<ContentSettings> contentSettings, IHostingEnvironment hostingEnvironment, IImageUrlGenerator imageUrlGenerator, IBackOfficeSecurityAccessor backofficeSecurityAccessor, IUserService userService, IUmbracoMapper umbracoMapper, IBackOfficeUserManager backOfficeUserManager, ILocalizedTextService localizedTextService, AppCaches appCaches, IShortStringHelper shortStringHelper, IPasswordChanger<BackOfficeIdentityUser> passwordChanger, IUserDataService userDataService)
    Parameters
    Type Name Description
    MediaFileManager mediaFileManager
    Microsoft.Extensions.Options.IOptions<ContentSettings> contentSettings
    IHostingEnvironment hostingEnvironment
    IImageUrlGenerator imageUrlGenerator
    IBackOfficeSecurityAccessor backofficeSecurityAccessor
    IUserService userService
    IUmbracoMapper umbracoMapper
    IBackOfficeUserManager backOfficeUserManager
    ILocalizedTextService localizedTextService
    AppCaches appCaches
    IShortStringHelper shortStringHelper
    IPasswordChanger<BackOfficeIdentityUser> passwordChanger
    IUserDataService userDataService

    Methods

    View Source

    GetCurrentUserLinkedLogins()

    Declaration
    [Authorize(Policy = "BackOfficeAccess")]
    [ValidateAngularAntiForgeryToken]
    public async Task<Dictionary<string, string>> GetCurrentUserLinkedLogins()
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.String, System.String>>
    View Source

    GetPermissions(Int32[])

    Returns permissions for all nodes passed in for the current user

    Declaration
    [HttpPost]
    public Dictionary<int, string[]> GetPermissions(int[] nodeIds)
    Parameters
    Type Name Description
    System.Int32[] nodeIds
    Returns
    Type Description
    System.Collections.Generic.Dictionary<System.Int32, System.String[]>
    View Source

    GetUserData()

    Declaration
    public IEnumerable<UserData> GetUserData()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<UserData>
    View Source

    GetUserTours()

    Returns the user's tours

    Declaration
    public IEnumerable<UserTourStatus> GetUserTours()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<UserTourStatus>
    View Source

    HasPermission(String, Int32)

    Checks a nodes permission for the current user

    Declaration
    [HttpGet]
    public bool HasPermission(string permissionToCheck, int nodeId)
    Parameters
    Type Name Description
    System.String permissionToCheck
    System.Int32 nodeId
    Returns
    Type Description
    System.Boolean
    View Source

    PostChangePassword(ChangingPasswordModel)

    Changes the users password

    Declaration
    public async Task<ActionResult<ModelWithNotifications<string>>> PostChangePassword(ChangingPasswordModel changingPasswordModel)
    Parameters
    Type Name Description
    ChangingPasswordModel changingPasswordModel

    The changing password model

    Returns
    Type Description
    System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult<ModelWithNotifications<System.String>>>

    If the password is being reset it will return the newly reset password, otherwise will return an empty value

    View Source

    PostSetAvatar(IList<IFormFile>)

    Declaration
    [AppendUserModifiedHeader]
    public IActionResult PostSetAvatar(IList<IFormFile> file)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<Microsoft.AspNetCore.Http.IFormFile> file
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.IActionResult
    View Source

    PostSetInvitedUserPassword(String)

    When a user is invited and they click on the invitation link, they will be partially logged in where they can set their username/password

    Declaration
    [AllowAnonymous]
    public async Task<ActionResult<UserDetail>> PostSetInvitedUserPassword([FromBody] string newPassword)
    Parameters
    Type Name Description
    System.String newPassword
    Returns
    Type Description
    System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult<UserDetail>>
    Remarks

    This only works when the user is logged in (partially)

    View Source

    PostSetUserTour(UserTourStatus)

    Saves a tour status for the current user

    Declaration
    public IEnumerable<UserTourStatus> PostSetUserTour(UserTourStatus status)
    Parameters
    Type Name Description
    UserTourStatus status
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<UserTourStatus>
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • CurrentUserController(MediaFileManager, IOptions<ContentSettings>, IHostingEnvironment, IImageUrlGenerator, IBackOfficeSecurityAccessor, IUserService, IUmbracoMapper, IBackOfficeUserManager, ILoggerFactory, ILocalizedTextService, AppCaches, IShortStringHelper, IPasswordChanger<BackOfficeIdentityUser>)
      • CurrentUserController(MediaFileManager, IOptions<ContentSettings>, IHostingEnvironment, IImageUrlGenerator, IBackOfficeSecurityAccessor, IUserService, IUmbracoMapper, IBackOfficeUserManager, ILocalizedTextService, AppCaches, IShortStringHelper, IPasswordChanger<BackOfficeIdentityUser>, IUserDataService)
    • Methods
      • GetCurrentUserLinkedLogins()
      • GetPermissions(Int32[])
      • GetUserData()
      • GetUserTours()
      • HasPermission(String, Int32)
      • PostChangePassword(ChangingPasswordModel)
      • PostSetAvatar(IList<IFormFile>)
      • PostSetInvitedUserPassword(String)
      • PostSetUserTour(UserTourStatus)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX