-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #939 from colinin/perf-organization-permissions
perf(permissions): organization permission efficiency.
- Loading branch information
Showing
3 changed files
with
83 additions
and
72 deletions.
There are no files selected for viewing
86 changes: 43 additions & 43 deletions
86
...ty/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IdentityPermissions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
using Volo.Abp.Reflection; | ||
|
||
namespace LINGYUN.Abp.Identity | ||
{ | ||
public class IdentityPermissions | ||
{ | ||
public static class Roles | ||
{ | ||
public const string ManageClaims = Volo.Abp.Identity.IdentityPermissions.Roles.Default + ".ManageClaims"; | ||
public const string ManageOrganizationUnits = Volo.Abp.Identity.IdentityPermissions.Roles.Default + ".ManageOrganizationUnits"; | ||
} | ||
|
||
public static class Users | ||
{ | ||
public const string ResetPassword = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ResetPassword"; | ||
public const string ManageClaims = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ManageClaims"; | ||
public const string ManageOrganizationUnits = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ManageOrganizationUnits"; | ||
} | ||
|
||
public static class OrganizationUnits | ||
{ | ||
public const string Default = Volo.Abp.Identity.IdentityPermissions.GroupName + ".OrganizationUnits"; | ||
public const string Create = Default + ".Create"; | ||
public const string Update = Default + ".Update"; | ||
public const string Delete = Default + ".Delete"; | ||
public const string ManageUsers = Default + ".ManageUsers"; | ||
using Volo.Abp.Reflection; | ||
|
||
namespace LINGYUN.Abp.Identity | ||
{ | ||
public class IdentityPermissions | ||
{ | ||
public static class Roles | ||
{ | ||
public const string ManageClaims = Volo.Abp.Identity.IdentityPermissions.Roles.Default + ".ManageClaims"; | ||
public const string ManageOrganizationUnits = Volo.Abp.Identity.IdentityPermissions.Roles.Default + ".ManageOrganizationUnits"; | ||
} | ||
|
||
public static class Users | ||
{ | ||
public const string ResetPassword = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ResetPassword"; | ||
public const string ManageClaims = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ManageClaims"; | ||
public const string ManageOrganizationUnits = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ManageOrganizationUnits"; | ||
} | ||
|
||
public static class OrganizationUnits | ||
{ | ||
public const string Default = Volo.Abp.Identity.IdentityPermissions.GroupName + ".OrganizationUnits"; | ||
public const string Create = Default + ".Create"; | ||
public const string Update = Default + ".Update"; | ||
public const string Delete = Default + ".Delete"; | ||
public const string ManageUsers = Default + ".ManageUsers"; | ||
public const string ManageRoles = Default + ".ManageRoles"; | ||
public const string ManagePermissions = Default + ".ManagePermissions"; | ||
} | ||
|
||
public static class IdentityClaimType | ||
{ | ||
public const string Default = Volo.Abp.Identity.IdentityPermissions.GroupName + ".IdentityClaimTypes"; | ||
public const string Create = Default + ".Create"; | ||
public const string Update = Default + ".Update"; | ||
public const string Delete = Default + ".Delete"; | ||
} | ||
|
||
public static string[] GetAll() | ||
{ | ||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(IdentityPermissions)); | ||
} | ||
} | ||
} | ||
public const string ManagePermissions = Default + ".ManagePermissions"; | ||
} | ||
|
||
public static class IdentityClaimType | ||
{ | ||
public const string Default = Volo.Abp.Identity.IdentityPermissions.GroupName + ".IdentityClaimTypes"; | ||
public const string Create = Default + ".Create"; | ||
public const string Update = Default + ".Update"; | ||
public const string Delete = Default + ".Delete"; | ||
} | ||
|
||
public static string[] GetAll() | ||
{ | ||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(IdentityPermissions)); | ||
} | ||
} | ||
} |
40 changes: 20 additions & 20 deletions
40
...ssionManagement/OrganizationUnits/AbpPermissionManagementDomainOrganizationUnitsModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
using LINGYUN.Abp.Authorization.OrganizationUnits; | ||
using LINGYUN.Abp.Authorization.Permissions; | ||
using LINGYUN.Abp.Identity; | ||
using Volo.Abp.Modularity; | ||
using Volo.Abp.Modularity; | ||
using Volo.Abp.PermissionManagement; | ||
|
||
namespace LINGYUN.Abp.PermissionManagement.OrganizationUnits; | ||
|
||
[DependsOn( | ||
typeof(AbpIdentityDomainModule), | ||
typeof(AbpPermissionManagementDomainModule), | ||
typeof(AbpAuthorizationOrganizationUnitsModule) | ||
)] | ||
public class AbpPermissionManagementDomainOrganizationUnitsModule : AbpModule | ||
{ | ||
public override void ConfigureServices(ServiceConfigurationContext context) | ||
{ | ||
Configure<PermissionManagementOptions>(options => | ||
{ | ||
options.ManagementProviders.Add<OrganizationUnitPermissionManagementProvider>(); | ||
options.ProviderPolicies[OrganizationUnitPermissionValueProvider.ProviderName] = "AbpIdentity.OrganizationUnits.ManagePermissions"; | ||
}); | ||
} | ||
} | ||
namespace LINGYUN.Abp.PermissionManagement.OrganizationUnits; | ||
|
||
[DependsOn( | ||
typeof(AbpIdentityDomainModule), | ||
typeof(AbpPermissionManagementDomainModule), | ||
typeof(AbpAuthorizationOrganizationUnitsModule) | ||
)] | ||
public class AbpPermissionManagementDomainOrganizationUnitsModule : AbpModule | ||
{ | ||
public override void ConfigureServices(ServiceConfigurationContext context) | ||
{ | ||
Configure<PermissionManagementOptions>(options => | ||
{ | ||
options.ManagementProviders.Add<OrganizationUnitPermissionManagementProvider>(); | ||
options.ProviderPolicies[OrganizationUnitPermissionValueProvider.ProviderName] = "AbpIdentity.OrganizationUnits.ManagePermissions"; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters