fixed migration

This commit is contained in:
Alexey Bannov 2023-09-29 14:39:22 +03:00
parent 84afb50b66
commit ba23f9bb7b
2 changed files with 5 additions and 3 deletions

View File

@ -24,6 +24,8 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
using AuthConstants = ASC.Common.Security.Authorizing.AuthConstants;
namespace ASC.Migration.PersonalToDocspace.Creator;
[Scope]
@ -192,7 +194,7 @@ public class MigrationCreator
using var userDbContextToregion = _creatorDbContext.CreateDbContext<UserDbContext>(_toRegion);
var usersCount = userDbContextToregion.Users
.Join(userDbContextToregion.UserGroups, u => u.Id, ug => ug.Userid, (u, ug) => new { u, ug })
.Where(q => q.u.TenantId == tenant.Id && q.ug.UserGroupId == Common.Security.Authorizing.Constants.DocSpaceAdmin.ID).Count();
.Where(q => q.u.TenantId == tenant.Id && q.ug.UserGroupId == AuthConstants.DocSpaceAdmin.ID).Count();
if (usersCount > qouta.CountRoomAdmin)
{
throw new ArgumentException("user count exceed");

View File

@ -24,7 +24,7 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
using ASC.Core;
using AuthConstants = ASC.Common.Security.Authorizing.AuthConstants;
namespace ASC.Migration.PersonalToDocspace.Runner;
@ -192,7 +192,7 @@ public class MigrationRunner
LastModified = DateTime.UtcNow,
RefType = ASC.Core.UserGroupRefType.Contains,
Removed = false,
UserGroupId = ASC.Common.Security.Authorizing.Constants.DocSpaceAdmin.ID,
UserGroupId = AuthConstants.DocSpaceAdmin.ID,
Userid = tenant.OwnerId.Value
};