diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessFilterOperate.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessFilterOperate.cs
index 844f4e424..c3064bdf9 100644
--- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessFilterOperate.cs
+++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessFilterOperate.cs
@@ -6,64 +6,54 @@ namespace LINGYUN.Abp.DataProtection;
///
public enum DataAccessFilterOperate
{
- ///
- /// 且
- ///
- [Description("且")]
- And = 1,
- ///
- /// 或
- ///
- [Description("或")]
- Or = 2,
///
/// 等于
///
[Description("等于")]
- Equal = 3,
+ Equal = 1,
///
/// 不等于
///
[Description("不等于")]
- NotEqual = 4,
+ NotEqual = 2,
///
/// 小于
///
[Description("小于")]
- Less = 5,
+ Less = 3,
///
/// 小于或等于
///
[Description("小于等于")]
- LessOrEqual = 6,
+ LessOrEqual = 4,
///
/// 大于
///
[Description("大于")]
- Greater = 7,
+ Greater = 5,
///
/// 大于或等于
///
[Description("大于等于")]
- GreaterOrEqual = 8,
+ GreaterOrEqual = 6,
///
/// 左包含
///
[Description("左包含")]
- StartsWith = 9,
+ StartsWith = 7,
///
/// 右包含
///
[Description("右包含")]
- EndsWith = 10,
+ EndsWith = 8,
///
/// 包含
///
[Description("包含")]
- Contains = 11,
+ Contains = 9,
///
/// 不包含
///
[Description("不包含")]
- NotContains = 12,
+ NotContains = 10,
}
\ No newline at end of file
diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/AbpDataProtectionModule.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/AbpDataProtectionModule.cs
index a1b59af62..982b7757a 100644
--- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/AbpDataProtectionModule.cs
+++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/AbpDataProtectionModule.cs
@@ -4,7 +4,7 @@ using LINGYUN.Abp.DataProtection.Operations;
using LINGYUN.Abp.DataProtection.Subjects;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Domain;
-using Volo.Abp.Localization;
+using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.DataProtection;
@@ -37,13 +37,14 @@ public class AbpDataProtectionModule : AbpModule
options.OperateContributors.Add(DataAccessFilterOperate.NotContains, new DataAccessNotContainsContributor());
options.SubjectContributors.Add(new DataAccessUserIdContributor());
+ options.SubjectContributors.Add(new DataAccessClientIdContributor());
options.SubjectContributors.Add(new DataAccessRoleNameContributor());
options.SubjectContributors.Add(new DataAccessOrganizationUnitContributor());
});
- Configure(options =>
+ Configure(options =>
{
- options.Resources.Add();
+ options.MapCodeNamespace("DataProtection", typeof(DataProtectionResource));
});
}
}
diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessClientIdContributor.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessClientIdContributor.cs
new file mode 100644
index 000000000..2c566076d
--- /dev/null
+++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessClientIdContributor.cs
@@ -0,0 +1,43 @@
+using Microsoft.Extensions.DependencyInjection;
+using System.Collections.Generic;
+using System.Linq;
+using Volo.Abp.Authorization.Permissions;
+using Volo.Abp.Clients;
+
+namespace LINGYUN.Abp.DataProtection.Subjects;
+public class DataAccessClientIdContributor : IDataAccessSubjectContributor
+{
+ public string Name => ClientPermissionValueProvider.ProviderName;
+
+ public virtual List GetAllowProperties(DataAccessSubjectContributorContext context)
+ {
+ var allowProperties = new List();
+ var currentClient = context.ServiceProvider.GetRequiredService();
+ if (currentClient.IsAuthenticated)
+ {
+ var resourceStore = context.ServiceProvider.GetRequiredService();
+ var resource = resourceStore.Get(Name, currentClient.Id, context.EntityTypeFullName, context.Operation);
+ if (resource?.AllowProperties.Any() == true)
+ {
+ allowProperties.AddIfNotContains(resource.AllowProperties);
+ }
+ }
+ return allowProperties;
+ }
+
+ public virtual List GetFilterGroups(DataAccessSubjectContributorContext context)
+ {
+ var groups = new List();
+ var currentClient = context.ServiceProvider.GetRequiredService();
+ if (currentClient.IsAuthenticated)
+ {
+ var resourceStore = context.ServiceProvider.GetRequiredService();
+ var resource = resourceStore.Get(Name, currentClient.Id, context.EntityTypeFullName, context.Operation);
+ if (resource?.FilterGroup != null)
+ {
+ groups.Add(resource.FilterGroup);
+ }
+ }
+ return groups;
+ }
+}