Skip to content

Commit

Permalink
💔 将OSharp.Permissions拆分为OSharp.Identity和OSharp.Authorization两个项目 #128
Browse files Browse the repository at this point in the history
💔 同时对原Security中的功能权限和数据权限进行Authorization的迁移 #128
  • Loading branch information
gmf520 committed Feb 26, 2020
1 parent 65dc22b commit 1ad123f
Show file tree
Hide file tree
Showing 142 changed files with 1,778 additions and 1,411 deletions.
28 changes: 14 additions & 14 deletions osharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSharp.MiniProfiler", "src\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSharp.NLog", "src\OSharp.NLog\OSharp.NLog.csproj", "{41A076D2-E9C1-4DE2-A116-D05544EB967D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSharp.Permissions", "src\OSharp.Permissions\OSharp.Permissions.csproj", "{5E1E63C1-F01A-491C-8864-37AEDBCC8AD0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSharp.Redis", "src\OSharp.Redis\OSharp.Redis.csproj", "{2E068082-A6F8-4FD7-8002-1DD8C649C46F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSharp.Swagger", "src\OSharp.Swagger\OSharp.Swagger.csproj", "{A998F090-4147-4FFB-9E8F-77DDACD55641}"
Expand Down Expand Up @@ -67,8 +65,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSharp.UnitTest.Infrastruct
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSharp.Tests", "tests\OSharp.Tests\OSharp.Tests.csproj", "{BE36FDE0-84ED-47DD-AC78-9E86F1064015}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSharp.Permissions.Tests", "tests\OSharp.Permissions.Tests\OSharp.Permissions.Tests.csproj", "{24814363-9FD0-4070-8165-F7809A05A798}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Liuliu.Demo.Core.Tests", "tests\Liuliu.Demo.Core.Tests\Liuliu.Demo.Core.Tests.csproj", "{4313E9E7-B5B1-4304-AE32-59067C82F380}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSharp.Wpf", "src\OSharp.Wpf\OSharp.Wpf.csproj", "{D926CFBD-1420-41DA-98F5-A873C955BB44}"
Expand All @@ -77,6 +73,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSharp.CodeGeneration.Tests
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSharp.AspNetCore.Tests", "tests\OSharp.AspNetCore.Tests\OSharp.AspNetCore.Tests.csproj", "{88731BE4-D4BB-4EFB-8F15-6F78FA93EAFB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OSharp.Identity", "src\OSharp.Identity\OSharp.Identity.csproj", "{6EDD457E-7848-47B9-A449-323AAFE854D0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OSharp.Authorization", "src\OSharp.Authorization\OSharp.Authorization.csproj", "{43F382F3-FB07-4EFE-AA6C-007756EC850A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -147,10 +147,6 @@ Global
{41A076D2-E9C1-4DE2-A116-D05544EB967D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41A076D2-E9C1-4DE2-A116-D05544EB967D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41A076D2-E9C1-4DE2-A116-D05544EB967D}.Release|Any CPU.Build.0 = Release|Any CPU
{5E1E63C1-F01A-491C-8864-37AEDBCC8AD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E1E63C1-F01A-491C-8864-37AEDBCC8AD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E1E63C1-F01A-491C-8864-37AEDBCC8AD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E1E63C1-F01A-491C-8864-37AEDBCC8AD0}.Release|Any CPU.Build.0 = Release|Any CPU
{2E068082-A6F8-4FD7-8002-1DD8C649C46F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E068082-A6F8-4FD7-8002-1DD8C649C46F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E068082-A6F8-4FD7-8002-1DD8C649C46F}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -179,10 +175,6 @@ Global
{BE36FDE0-84ED-47DD-AC78-9E86F1064015}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE36FDE0-84ED-47DD-AC78-9E86F1064015}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE36FDE0-84ED-47DD-AC78-9E86F1064015}.Release|Any CPU.Build.0 = Release|Any CPU
{24814363-9FD0-4070-8165-F7809A05A798}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24814363-9FD0-4070-8165-F7809A05A798}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24814363-9FD0-4070-8165-F7809A05A798}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24814363-9FD0-4070-8165-F7809A05A798}.Release|Any CPU.Build.0 = Release|Any CPU
{4313E9E7-B5B1-4304-AE32-59067C82F380}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4313E9E7-B5B1-4304-AE32-59067C82F380}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4313E9E7-B5B1-4304-AE32-59067C82F380}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -199,6 +191,14 @@ Global
{88731BE4-D4BB-4EFB-8F15-6F78FA93EAFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88731BE4-D4BB-4EFB-8F15-6F78FA93EAFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88731BE4-D4BB-4EFB-8F15-6F78FA93EAFB}.Release|Any CPU.Build.0 = Release|Any CPU
{6EDD457E-7848-47B9-A449-323AAFE854D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6EDD457E-7848-47B9-A449-323AAFE854D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6EDD457E-7848-47B9-A449-323AAFE854D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6EDD457E-7848-47B9-A449-323AAFE854D0}.Release|Any CPU.Build.0 = Release|Any CPU
{43F382F3-FB07-4EFE-AA6C-007756EC850A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43F382F3-FB07-4EFE-AA6C-007756EC850A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43F382F3-FB07-4EFE-AA6C-007756EC850A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{43F382F3-FB07-4EFE-AA6C-007756EC850A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -220,7 +220,6 @@ Global
{1E560A54-864A-496B-A770-105CDBFE4C6E} = {611006C4-BCE9-4EDC-8473-A85530C7FADE}
{22F6657E-626C-41DF-AB9F-02ACE3752038} = {611006C4-BCE9-4EDC-8473-A85530C7FADE}
{41A076D2-E9C1-4DE2-A116-D05544EB967D} = {611006C4-BCE9-4EDC-8473-A85530C7FADE}
{5E1E63C1-F01A-491C-8864-37AEDBCC8AD0} = {611006C4-BCE9-4EDC-8473-A85530C7FADE}
{2E068082-A6F8-4FD7-8002-1DD8C649C46F} = {611006C4-BCE9-4EDC-8473-A85530C7FADE}
{A998F090-4147-4FFB-9E8F-77DDACD55641} = {611006C4-BCE9-4EDC-8473-A85530C7FADE}
{97AC2C5A-5B18-4B4A-BE98-5AD4D68357E5} = {D06C79AC-DB5A-4379-BA2B-5208CF3FBC23}
Expand All @@ -229,11 +228,12 @@ Global
{7A5907F6-C38F-45A7-B2A2-C172A7723FB0} = {97AC2C5A-5B18-4B4A-BE98-5AD4D68357E5}
{1B047F1A-FECC-4887-962B-E6B165B23D8F} = {076AC484-B515-4590-BA3E-59D0CCBA3E3A}
{BE36FDE0-84ED-47DD-AC78-9E86F1064015} = {076AC484-B515-4590-BA3E-59D0CCBA3E3A}
{24814363-9FD0-4070-8165-F7809A05A798} = {076AC484-B515-4590-BA3E-59D0CCBA3E3A}
{4313E9E7-B5B1-4304-AE32-59067C82F380} = {076AC484-B515-4590-BA3E-59D0CCBA3E3A}
{D926CFBD-1420-41DA-98F5-A873C955BB44} = {611006C4-BCE9-4EDC-8473-A85530C7FADE}
{E96A4982-F4DF-4C15-A8A3-7AA95D8363AA} = {076AC484-B515-4590-BA3E-59D0CCBA3E3A}
{88731BE4-D4BB-4EFB-8F15-6F78FA93EAFB} = {076AC484-B515-4590-BA3E-59D0CCBA3E3A}
{6EDD457E-7848-47B9-A449-323AAFE854D0} = {611006C4-BCE9-4EDC-8473-A85530C7FADE}
{43F382F3-FB07-4EFE-AA6C-007756EC850A} = {611006C4-BCE9-4EDC-8473-A85530C7FADE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F1A8840B-B7DE-410D-9FA7-BA36515D2E11}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

using System;

using Liuliu.Demo.Authorization.Entities;
using Liuliu.Demo.Identity.Entities;
using Liuliu.Demo.Security.Entities;

using OSharp.Authorization;
using OSharp.Authorization.EntityInfos;
using OSharp.Security;


namespace Liuliu.Demo.Security
namespace Liuliu.Demo.Authorization
{
/// <summary>
/// 数据权限缓存
Expand Down
44 changes: 44 additions & 0 deletions samples/web/Liuliu.Demo.Core/Authorization/DataAuthManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// -----------------------------------------------------------------------
// <copyright file="DataAuthorizationManager.cs" company="OSharp开源团队">
// Copyright (c) 2014-2020 OSharp. All rights reserved.
// </copyright>
// <site>http://www.osharp.org</site>
// <last-editor>郭明锋</last-editor>
// <last-date>2020-02-27 0:31</last-date>
// -----------------------------------------------------------------------

using System;

using Liuliu.Demo.Authorization.Dtos;
using Liuliu.Demo.Authorization.Entities;
using Liuliu.Demo.Identity.Entities;

using OSharp.Authorization.DataAuthorization;
using OSharp.Authorization.Dtos;
using OSharp.Authorization.EntityInfos;
using OSharp.Entity;
using OSharp.EventBuses;


namespace Liuliu.Demo.Authorization
{
/// <summary>
/// 数据权限管理器
/// </summary>
public class DataAuthManager : DataAuthorizationManagerBase<EntityInfo, EntityInfoInputDto, EntityRole, EntityRoleInputDto, Role, int>
{
/// <summary>
/// 初始化一个 SecurityManager 类型的新实例
/// </summary>
/// <param name="eventBus">事件总线</param>
/// <param name="entityInfoRepository">实体仓储</param>
/// <param name="entityRoleRepository">实体角色仓储</param>
/// <param name="roleRepository">角色仓储</param>
protected DataAuthManager(IEventBus eventBus,
IRepository<EntityInfo, Guid> entityInfoRepository,
IRepository<EntityRole, Guid> entityRoleRepository,
IRepository<Role, int> roleRepository)
: base(eventBus, entityInfoRepository, entityRoleRepository, roleRepository)
{ }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// -----------------------------------------------------------------------
// <copyright file="DataAuthorizationPack.cs" company="OSharp开源团队">
// Copyright (c) 2014-2020 OSharp. All rights reserved.
// </copyright>
// <site>http://www.osharp.org</site>
// <last-editor>郭明锋</last-editor>
// <last-date>2020-02-27 0:35</last-date>
// -----------------------------------------------------------------------

using System.ComponentModel;

using Liuliu.Demo.Authorization.Dtos;
using Liuliu.Demo.Authorization.Entities;

using OSharp.Authorization;
using OSharp.Authorization.Dtos;
using OSharp.Authorization.EntityInfos;


namespace Liuliu.Demo.Authorization
{
public class DataAuthorizationPack
: DataAuthorizationPackBase<DataAuthManager, DataAuthCache, EntityInfo, EntityInfoInputDto, EntityRole, EntityRoleInputDto, int>
{ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

using AutoMapper.Configuration;

using Liuliu.Demo.Security.Entities;
using Liuliu.Demo.Authorization.Entities;

using Microsoft.Extensions.DependencyInjection;

Expand All @@ -18,7 +18,7 @@
using OSharp.Json;


namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// DTO对象映射类
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using OSharp.Mapping;


namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 实体信息节点
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using OSharp.Mapping;


namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 输出DTO:实体信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
// <last-date>2018-07-03 23:11</last-date>
// -----------------------------------------------------------------------

using OSharp.Security;
using OSharp.Authorization.Dtos;


namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 输入DTO:实体角色信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

using System;

using Liuliu.Demo.Security.Entities;
using Liuliu.Demo.Authorization.Entities;

using OSharp.Authorization;
using OSharp.Entity;
Expand All @@ -18,7 +18,7 @@
using OSharp.Mapping;


namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 输出DTO: 角色数据权限
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using OSharp.Mapping;


namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 功能输出DTO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using OSharp.Mapping;


namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 简单功能输出DTO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
// <last-date>2018-06-27 4:44</last-date>
// -----------------------------------------------------------------------

using Liuliu.Demo.Security.Entities;
using Liuliu.Demo.Authorization.Entities;

using OSharp.Authorization.Dtos;
using OSharp.Mapping;
using OSharp.Security;


namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 输入DTO:模块信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
// <last-date>2018-06-27 4:44</last-date>
// -----------------------------------------------------------------------

using Liuliu.Demo.Security.Entities;
using Liuliu.Demo.Authorization.Entities;

using OSharp.Entity;
using OSharp.Mapping;


namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 输入DTO:模块信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System;


namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 模块设置功能DTO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// <last-date>2018-07-08 13:10</last-date>
// -----------------------------------------------------------------------

namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 角色设置权限DTO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// <last-date>2018-07-08 12:21</last-date>
// -----------------------------------------------------------------------

namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 用户设置模块DTO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// <last-date>2018-07-08 12:21</last-date>
// -----------------------------------------------------------------------

namespace Liuliu.Demo.Security.Dtos
namespace Liuliu.Demo.Authorization.Dtos
{
/// <summary>
/// 用户设置角色DTO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

using Liuliu.Demo.Identity.Entities;

using OSharp.Authorization.Entities;
using OSharp.Authorization.EntityInfos;
using OSharp.Security;


namespace Liuliu.Demo.Security.Entities
namespace Liuliu.Demo.Authorization.Entities
{
/// <summary>
/// 实体:数据角色信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

using Liuliu.Demo.Identity.Entities;

using OSharp.Authorization.Entities;
using OSharp.Authorization.EntityInfos;
using OSharp.Security;


namespace Liuliu.Demo.Security.Entities
namespace Liuliu.Demo.Authorization.Entities
{
/// <summary>
/// 实体:数据用户信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
using System.Collections.Generic;
using System.ComponentModel;

using OSharp.Security;
using OSharp.Authorization.Entities;


namespace Liuliu.Demo.Security.Entities
namespace Liuliu.Demo.Authorization.Entities
{
/// <summary>
/// 实体类:模块信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

using System.ComponentModel;

using OSharp.Authorization.Entities;
using OSharp.Authorization.Functions;
using OSharp.Security;


namespace Liuliu.Demo.Security.Entities
namespace Liuliu.Demo.Authorization.Entities
{
/// <summary>
/// 实体类:模块功能信息
Expand Down
Loading

0 comments on commit 1ad123f

Please sign in to comment.