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
Assembly: Umbraco.Web.BackOffice.dll
Syntax
[PluginController("UmbracoApi")]
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
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
View Source
CurrentUserController(MediaFileManager, IOptionsSnapshot<ContentSettings>, IHostingEnvironment, IImageUrlGenerator, IBackOfficeSecurityAccessor, IUserService, IUmbracoMapper, IBackOfficeUserManager, ILocalizedTextService, AppCaches, IShortStringHelper, IPasswordChanger<BackOfficeIdentityUser>, IUserDataService)
Declaration
public CurrentUserController(MediaFileManager mediaFileManager, IOptionsSnapshot<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
View Source
CurrentUserController(MediaFileManager, IOptionsSnapshot<ContentSettings>, IHostingEnvironment, IImageUrlGenerator, IBackOfficeSecurityAccessor, IUserService, IUmbracoMapper, IBackOfficeUserManager, ILocalizedTextService, AppCaches, IShortStringHelper, IPasswordChanger<BackOfficeIdentityUser>, IUserDataService, IFileStreamSecurityValidator)
Declaration
[ActivatorUtilitiesConstructor]
public CurrentUserController(MediaFileManager mediaFileManager, IOptionsSnapshot<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, IFileStreamSecurityValidator fileStreamSecurityValidator)
Parameters
Methods
View Source
GetCurrentUserLinkedLogins()
Declaration
[Authorize(Policy = "BackOfficeAccess")]
[ValidateAngularAntiForgeryToken]
public async Task<Dictionary<string, string>> GetCurrentUserLinkedLogins()
Returns
Type |
Description |
Task<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 |
Dictionary<System.Int32, System.String[]> |
|
View Source
GetUserData()
Declaration
public IEnumerable<UserData> GetUserData()
Returns
View Source
GetUserTours()
Declaration
public IEnumerable<UserTourStatus>? GetUserTours()
Returns
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
Returns
Type |
Description |
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 |
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 |
Task<Microsoft.AspNetCore.Mvc.ActionResult<UserDetail>> |
|
View Source
PostSetUserTour(UserTourStatus)
Saves a tour status for the current user
Declaration
public IEnumerable<UserTourStatus> PostSetUserTour(UserTourStatus status)
Parameters
Returns