View Source
Class UsersController
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Assembly: Umbraco.Web.BackOffice.dll
Syntax
[PluginController("UmbracoApi")]
[Authorize(Policy = "SectionAccessUsers")]
[PrefixlessBodyModelValidator]
public class UsersController : BackOfficeNotificationsController, IUmbracoFeature, IDiscoverable
Constructors
View Source
UsersController(MediaFileManager, IOptionsSnapshot<ContentSettings>, IHostingEnvironment, ISqlContext, IImageUrlGenerator, IOptionsSnapshot<SecuritySettings>, IEmailSender, IBackOfficeSecurityAccessor, AppCaches, IShortStringHelper, IUserService, ILocalizedTextService, IUmbracoMapper, IOptionsSnapshot<GlobalSettings>, IBackOfficeUserManager, ILoggerFactory, LinkGenerator, IBackOfficeExternalLoginProviders, UserEditorAuthorizationHelper, IPasswordChanger<BackOfficeIdentityUser>, IHttpContextAccessor, IOptions<WebRoutingSettings>)
Declaration
public UsersController(MediaFileManager mediaFileManager, IOptionsSnapshot<ContentSettings> contentSettings, IHostingEnvironment hostingEnvironment, ISqlContext sqlContext, IImageUrlGenerator imageUrlGenerator, IOptionsSnapshot<SecuritySettings> securitySettings, IEmailSender emailSender, IBackOfficeSecurityAccessor backofficeSecurityAccessor, AppCaches appCaches, IShortStringHelper shortStringHelper, IUserService userService, ILocalizedTextService localizedTextService, IUmbracoMapper umbracoMapper, IOptionsSnapshot<GlobalSettings> globalSettings, IBackOfficeUserManager backOfficeUserManager, ILoggerFactory loggerFactory, LinkGenerator linkGenerator, IBackOfficeExternalLoginProviders externalLogins, UserEditorAuthorizationHelper userEditorAuthorizationHelper, IPasswordChanger<BackOfficeIdentityUser> passwordChanger, IHttpContextAccessor httpContextAccessor, IOptions<WebRoutingSettings> webRoutingSettings)
Parameters
View Source
UsersController(MediaFileManager, IOptionsSnapshot<ContentSettings>, IHostingEnvironment, ISqlContext, IImageUrlGenerator, IOptionsSnapshot<SecuritySettings>, IEmailSender, IBackOfficeSecurityAccessor, AppCaches, IShortStringHelper, IUserService, ILocalizedTextService, IUmbracoMapper, IOptionsSnapshot<GlobalSettings>, IBackOfficeUserManager, ILoggerFactory, LinkGenerator, IBackOfficeExternalLoginProviders, UserEditorAuthorizationHelper, IPasswordChanger<BackOfficeIdentityUser>, IHttpContextAccessor, IOptions<WebRoutingSettings>, IFileStreamSecurityValidator)
Declaration
[ActivatorUtilitiesConstructor]
public UsersController(MediaFileManager mediaFileManager, IOptionsSnapshot<ContentSettings> contentSettings, IHostingEnvironment hostingEnvironment, ISqlContext sqlContext, IImageUrlGenerator imageUrlGenerator, IOptionsSnapshot<SecuritySettings> securitySettings, IEmailSender emailSender, IBackOfficeSecurityAccessor backofficeSecurityAccessor, AppCaches appCaches, IShortStringHelper shortStringHelper, IUserService userService, ILocalizedTextService localizedTextService, IUmbracoMapper umbracoMapper, IOptionsSnapshot<GlobalSettings> globalSettings, IBackOfficeUserManager backOfficeUserManager, ILoggerFactory loggerFactory, LinkGenerator linkGenerator, IBackOfficeExternalLoginProviders externalLogins, UserEditorAuthorizationHelper userEditorAuthorizationHelper, IPasswordChanger<BackOfficeIdentityUser> passwordChanger, IHttpContextAccessor httpContextAccessor, IOptions<WebRoutingSettings> webRoutingSettings, IFileStreamSecurityValidator fileStreamSecurityValidator)
Parameters
Methods
View Source
GetById(Int32)
Declaration
[Authorize(Policy = "AdminUserEditsRequireAdmin")]
public ActionResult<UserDisplay> GetById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<UserDisplay> |
|
View Source
GetByIds(Int32[])
Declaration
[Authorize(Policy = "AdminUserEditsRequireAdmin")]
public ActionResult<IEnumerable<UserDisplay>> GetByIds([FromJsonPath] int[] ids)
Parameters
Type |
Name |
Description |
System.Int32[] |
ids |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<IEnumerable<UserDisplay>> |
|
View Source
GetCurrentUserAvatarUrls()
Returns a list of the sizes of gravatar URLs for the user or null if the gravatar server cannot be reached
Declaration
public ActionResult<string[]> GetCurrentUserAvatarUrls()
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.String[]> |
|
View Source
GetPagedUsers(Int32, Int32, String, Direction, String[], UserState[], String)
Returns a paged users collection
Declaration
public UsersController.PagedUserResult GetPagedUsers(int pageNumber = 1, int pageSize = 10, string orderBy = "username", Direction orderDirection = Direction.Ascending, [FromQuery] string[] userGroups = null, [FromQuery] UserState[] userStates = null, string filter = "")
Parameters
Type |
Name |
Description |
System.Int32 |
pageNumber |
|
System.Int32 |
pageSize |
|
System.String |
orderBy |
|
Direction |
orderDirection |
|
System.String[] |
userGroups |
|
UserState[] |
userStates |
|
System.String |
filter |
|
Returns
View Source
PostChangePassword(ChangingPasswordModel)
Declaration
public async Task<ActionResult<ModelWithNotifications<string>>> PostChangePassword(ChangingPasswordModel changingPasswordModel)
Parameters
Returns
View Source
PostClearAvatar(Int32)
Declaration
[AppendUserModifiedHeader("id")]
[Authorize(Policy = "AdminUserEditsRequireAdmin")]
public ActionResult<string[]> PostClearAvatar(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.String[]> |
|
View Source
PostCreateUser(UserInvite)
Declaration
public async Task<ActionResult<UserDisplay>> PostCreateUser(UserInvite userSave)
Parameters
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<UserDisplay>> |
|
View Source
PostDeleteNonLoggedInUser(Int32)
Deletes the non-logged in user provided id
Declaration
[Authorize(Policy = "AdminUserEditsRequireAdmin")]
public IActionResult PostDeleteNonLoggedInUser(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
User Id
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostDisableUsers(Int32[])
Disables the users with the given user ids
Declaration
[Authorize(Policy = "AdminUserEditsRequireAdmin")]
public IActionResult PostDisableUsers([FromQuery] int[] userIds)
Parameters
Type |
Name |
Description |
System.Int32[] |
userIds |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostEnableUsers(Int32[])
Enables the users with the given user ids
Declaration
[Authorize(Policy = "AdminUserEditsRequireAdmin")]
public IActionResult PostEnableUsers([FromQuery] int[] userIds)
Parameters
Type |
Name |
Description |
System.Int32[] |
userIds |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostInviteUser(UserInvite)
Declaration
public async Task<ActionResult<UserDisplay>> PostInviteUser(UserInvite userSave)
Parameters
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<UserDisplay>> |
|
View Source
PostSaveUser(UserSave)
Declaration
public ActionResult<UserDisplay> PostSaveUser(UserSave userSave)
Parameters
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<UserDisplay> |
|
View Source
PostSetAvatar(Int32, IList<IFormFile>)
Declaration
[AppendUserModifiedHeader("id")]
[Authorize(Policy = "AdminUserEditsRequireAdmin")]
public IActionResult PostSetAvatar(int id, IList<IFormFile> file)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
IList<Microsoft.AspNetCore.Http.IFormFile> |
file |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostSetUserGroupsOnUsers(String[], Int32[])
Declaration
[Authorize(Policy = "AdminUserEditsRequireAdmin")]
public IActionResult PostSetUserGroupsOnUsers([FromQuery] string[] userGroupAliases, [FromQuery] int[] userIds)
Parameters
Type |
Name |
Description |
System.String[] |
userGroupAliases |
|
System.Int32[] |
userIds |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostUnlockUsers(Int32[])
Unlocks the users with the given user ids
Declaration
[Authorize(Policy = "AdminUserEditsRequireAdmin")]
public async Task<IActionResult> PostUnlockUsers([FromQuery] int[] userIds)
Parameters
Type |
Name |
Description |
System.Int32[] |
userIds |
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.IActionResult> |
|