Skip to content

Commit

Permalink
fix Bug 70167
Browse files Browse the repository at this point in the history
  • Loading branch information
MaksimChegulov committed Sep 12, 2024
1 parent 4c3f382 commit 43e45db
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions products/ASC.Files/Core/Utils/SocketManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode

using System.Threading.Channels;

using ASC.Core.Billing;

namespace ASC.Web.Files.Utils;
Expand Down Expand Up @@ -197,7 +196,7 @@ private async Task<List<Guid>> WhoCanRead<T>(FileEntry<T> entry)

var userIds = whoCanRead
.SelectMany(r => r)
.Concat(new []{ entry.CreateBy })
.Concat([entry.CreateBy])
.Distinct()
.ToList();

Expand All @@ -207,23 +206,19 @@ private async Task<List<Guid>> WhoCanRead<T>(FileEntry<T> entry)
private List<Guid> _admins;
private Task<IEnumerable<Guid>> Admins()
{
if (_admins != null)
{
return Task.FromResult<IEnumerable<Guid>>(_admins);
}

return AdminsFromDb();
return _admins != null
? Task.FromResult<IEnumerable<Guid>>(_admins)
: AdminsFromDb();
}

private async Task<IEnumerable<Guid>> AdminsFromDb()
{
_admins = await userManager.GetUsers(true, EmployeeStatus.Active, null, null, null, null,
null, null, null, null, false, null, true, 0, 0)
.Select(r=> r.Id)
.ToListAsync();
_admins = (await userManager.GetUsersByGroupAsync(Constants.GroupAdmin.ID))
.Select(x => x.Id)
.ToList();

_admins.Add((await _tenantManager.GetCurrentTenantAsync()).OwnerId);

return _admins;
}
}
}

0 comments on commit 43e45db

Please sign in to comment.