diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RequirePermissionsSimpleBatchStateChecker.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RequirePermissionsSimpleBatchStateChecker.cs index 5cce51ec51..f02ce38c74 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RequirePermissionsSimpleBatchStateChecker.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RequirePermissionsSimpleBatchStateChecker.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; @@ -22,7 +22,16 @@ namespace Volo.Abp.Authorization.Permissions { Check.NotNullOrEmpty(models, nameof(models)); - _models.AddRange(models); + foreach (var model in models) + { + if (!_models.Any(x => x.State.GetType() == model.State.GetType() && + x.RequiresAll == model.RequiresAll && + x.Permissions.SequenceEqual(model.Permissions))) + { + _models.Add(model); + } + } + return this; }