|
|
|
@ -37,7 +37,6 @@ namespace Ombi.Controllers
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The Identity Controller, the API for everything Identity/User related
|
|
|
|
|
/// </summary>
|
|
|
|
|
[PowerUser]
|
|
|
|
|
[ApiV1]
|
|
|
|
|
[Produces("application/json")]
|
|
|
|
|
public class IdentityController : Controller
|
|
|
|
@ -128,6 +127,7 @@ namespace Ombi.Controllers
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>Information about all users</returns>
|
|
|
|
|
[HttpGet("Users")]
|
|
|
|
|
[PowerUser]
|
|
|
|
|
public async Task<IEnumerable<UserViewModel>> GetAllUsers()
|
|
|
|
|
{
|
|
|
|
|
var users = await UserManager.Users
|
|
|
|
@ -161,6 +161,7 @@ namespace Ombi.Controllers
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>Information about the user</returns>
|
|
|
|
|
[HttpGet("User/{id}")]
|
|
|
|
|
[PowerUser]
|
|
|
|
|
public async Task<UserViewModel> GetUser(string id)
|
|
|
|
|
{
|
|
|
|
|
var user = await UserManager.Users.FirstOrDefaultAsync(x => x.Id == id);
|
|
|
|
@ -213,6 +214,7 @@ namespace Ombi.Controllers
|
|
|
|
|
/// <param name = "user" > The user.</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[PowerUser]
|
|
|
|
|
public async Task<OmbiIdentityResult> CreateUser([FromBody] UserViewModel user)
|
|
|
|
|
{
|
|
|
|
|
if (!EmailValidator.IsValidEmail(user.EmailAddress))
|
|
|
|
@ -337,6 +339,7 @@ namespace Ombi.Controllers
|
|
|
|
|
/// <param name = "ui" > The user.</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPut]
|
|
|
|
|
[PowerUser]
|
|
|
|
|
public async Task<OmbiIdentityResult> UpdateUser([FromBody] UserViewModel ui)
|
|
|
|
|
{
|
|
|
|
|
if (!EmailValidator.IsValidEmail(ui.EmailAddress))
|
|
|
|
@ -392,6 +395,7 @@ namespace Ombi.Controllers
|
|
|
|
|
/// <param name="userId">The user.</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpDelete("{userId}")]
|
|
|
|
|
[PowerUser]
|
|
|
|
|
public async Task<OmbiIdentityResult> DeleteUser(string userId)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -420,6 +424,7 @@ namespace Ombi.Controllers
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("claims")]
|
|
|
|
|
[PowerUser]
|
|
|
|
|
public async Task<IEnumerable<ClaimCheckboxes>> GetAllClaims()
|
|
|
|
|
{
|
|
|
|
|
var claims = new List<ClaimCheckboxes>();
|
|
|
|
@ -527,6 +532,7 @@ namespace Ombi.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost("welcomeEmail")]
|
|
|
|
|
[PowerUser]
|
|
|
|
|
public void SendWelcomeEmail([FromBody] UserViewModel user)
|
|
|
|
|
{
|
|
|
|
|
var ombiUser = new OmbiUser
|
|
|
|
|