#2363 Added the ability to pass any username into the API using the ApiAlias header

This commit is contained in:
tidusjar 2019-01-16 21:33:15 +00:00
commit 3b91392323
18 changed files with 1455 additions and 116 deletions

View file

@ -34,7 +34,7 @@ namespace Ombi.Store.Entities
public bool IsEmbyConnect => UserType == UserType.EmbyUser && EmbyConnectUserId.HasValue();
[NotMapped]
public string UserAlias => string.IsNullOrEmpty(Alias) ? UserName : Alias;
public virtual string UserAlias => string.IsNullOrEmpty(Alias) ? UserName : Alias;
[NotMapped]
public bool EmailLogin { get; set; }

View file

@ -17,6 +17,7 @@ namespace Ombi.Store.Entities.Requests
public DateTime MarkedAsDenied { get; set; }
public string DeniedReason { get; set; }
public RequestType RequestType { get; set; }
public string RequestedByAlias { get; set; }
[ForeignKey(nameof(RequestedUserId))]
public OmbiUser RequestedUser { get; set; }

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Ombi.Store.Migrations
{
public partial class RequestedByAlias : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "RequestedByAlias",
table: "MovieRequests",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RequestedByAlias",
table: "ChildRequests",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RequestedByAlias",
table: "AlbumRequests",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "RequestedByAlias",
table: "MovieRequests");
migrationBuilder.DropColumn(
name: "RequestedByAlias",
table: "ChildRequests");
migrationBuilder.DropColumn(
name: "RequestedByAlias",
table: "AlbumRequests");
}
}
}

View file

@ -14,7 +14,7 @@ namespace Ombi.Store.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687");
.HasAnnotation("ProductVersion", "2.2.1-servicing-10028");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
@ -583,6 +583,8 @@ namespace Ombi.Store.Migrations
b.Property<int>("RequestType");
b.Property<string>("RequestedByAlias");
b.Property<DateTime>("RequestedDate");
b.Property<string>("RequestedUserId");
@ -621,6 +623,8 @@ namespace Ombi.Store.Migrations
b.Property<int>("RequestType");
b.Property<string>("RequestedByAlias");
b.Property<DateTime>("RequestedDate");
b.Property<string>("RequestedUserId");
@ -749,6 +753,8 @@ namespace Ombi.Store.Migrations
b.Property<int>("RequestType");
b.Property<string>("RequestedByAlias");
b.Property<DateTime>("RequestedDate");
b.Property<string>("RequestedUserId");