Skip to content

Commit cf10d78

Browse files
authored
Merge pull request #21445 from mazarkaman/dev
Update PermissionDataSeeder.cs
2 parents ed303db + 7860222 commit cf10d78

File tree

1 file changed

+2
-13
lines changed
  • modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement

1 file changed

+2
-13
lines changed

modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDataSeeder.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,8 @@ public virtual async Task SeedAsync(
3535
{
3636
var names = grantedPermissions.ToArray();
3737
var existsPermissionGrants = (await PermissionGrantRepository.GetListAsync(names, providerName, providerKey)).Select(x => x.Name).ToList();
38-
39-
foreach (var permissionName in names.Except(existsPermissionGrants))
40-
{
41-
await PermissionGrantRepository.InsertAsync(
42-
new PermissionGrant(
43-
GuidGenerator.Create(),
44-
permissionName,
45-
providerName,
46-
providerKey,
47-
tenantId
48-
)
49-
);
50-
}
38+
var permissions = names.Except(existsPermissionGrants).Select(permissionName => new PermissionGrant(GuidGenerator.Create(), permissionName, providerName, providerKey, tenantId)).ToList();
39+
await PermissionGrantRepository.InsertManyAsync(permissions);
5140
}
5241
}
5342
}

0 commit comments

Comments
 (0)