mirror of https://github.com/EasyAbp/EShop.git
41 changed files with 4527 additions and 96 deletions
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using EasyAbp.EShop.Stores.Stores; |
|||
|
|||
namespace EasyAbp.EShop.Stores.StoreOwners.Dtos |
|||
{ |
|||
public class CreateUpdateStoreOwnerDto : IMultiStore |
|||
{ |
|||
[Required] |
|||
public Guid StoreId { get; set; } |
|||
|
|||
[Required] |
|||
public Guid OwnerUserId { get; set; } |
|||
} |
|||
} |
|||
8
modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs → modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/BasicStorePermissionAuthorizationHandler.cs
8
modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs → modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/BasicStorePermissionAuthorizationHandler.cs
@ -0,0 +1,9 @@ |
|||
using System; |
|||
|
|||
namespace EasyAbp.EShop.Stores.Authorization |
|||
{ |
|||
public class StoreInfo |
|||
{ |
|||
public Guid StoreId { get; set; } |
|||
} |
|||
} |
|||
7
modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs → modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StorePermissionAuthorizationRequirement.cs
7
modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs → modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StorePermissionAuthorizationRequirement.cs
@ -1,18 +1,15 @@ |
|||
using System; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
|
|||
namespace EasyAbp.EShop.Stores.Permissions |
|||
namespace EasyAbp.EShop.Stores.Authorization |
|||
{ |
|||
public class StorePermissionAuthorizationRequirement : IAuthorizationRequirement |
|||
{ |
|||
public StorePermissionAuthorizationRequirement(Guid storeId, string policyName = null) |
|||
public StorePermissionAuthorizationRequirement(string policyName = null) |
|||
{ |
|||
StoreId = storeId; |
|||
PolicyName = policyName; |
|||
} |
|||
|
|||
public Guid StoreId { get; } |
|||
|
|||
public string PolicyName { get; } |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,46 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace EShopSample.Migrations |
|||
{ |
|||
public partial class AddedStoreOwnerEntity : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.CreateTable( |
|||
name: "EasyAbpEShopStoresStoreOwners", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(nullable: false), |
|||
ExtraProperties = table.Column<string>(nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true), |
|||
CreationTime = table.Column<DateTime>(nullable: false), |
|||
CreatorId = table.Column<Guid>(nullable: true), |
|||
LastModificationTime = table.Column<DateTime>(nullable: true), |
|||
LastModifierId = table.Column<Guid>(nullable: true), |
|||
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false), |
|||
DeleterId = table.Column<Guid>(nullable: true), |
|||
DeletionTime = table.Column<DateTime>(nullable: true), |
|||
TenantId = table.Column<Guid>(nullable: true), |
|||
StoreId = table.Column<Guid>(nullable: false), |
|||
OwnerUserId = table.Column<Guid>(nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_EasyAbpEShopStoresStoreOwners", x => x.Id); |
|||
}); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_EasyAbpEShopStoresStoreOwners_OwnerUserId_StoreId", |
|||
table: "EasyAbpEShopStoresStoreOwners", |
|||
columns: new[] { "OwnerUserId", "StoreId" }, |
|||
unique: true); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "EasyAbpEShopStoresStoreOwners"); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue