diff --git a/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs b/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs index bfae6a1d1f3..b6c8a41ae72 100644 --- a/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs +++ b/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs @@ -164,15 +164,15 @@ public override async Task> GetAuditEventsAsync(DateTi limit: 100); } + var docSpaceAdmin = await _userManager.IsDocSpaceAdminAsync(userId); + var disabledRooms = _roomsNotificationSettingsHelper.GetDisabledRoomsForCurrentUser(); - var userRoomsWithRole = await GetUserRoomsWithRoleAsync(userId); + var userRoomsWithRole = await GetUserRoomsWithRoleAsync(userId, docSpaceAdmin); var userRoomsWithRoleForSend = userRoomsWithRole.Where(r => !disabledRooms.Contains(r.Key)); var userRoomsForSend = userRoomsWithRoleForSend.Select(r => r.Key); - var docSpaceAdmin = await _userManager.IsDocSpaceAdminAsync(userId); - var result = new List(); foreach (var e in events) @@ -290,7 +290,7 @@ public override string Description public override ProductContext Context => _productContext; public override string ApiURL => string.Empty; - private async Task> GetUserRoomsWithRoleAsync(Guid userId) + private async Task> GetUserRoomsWithRoleAsync(Guid userId, bool isDocSpaceAdmin) { var result = new Dictionary(); @@ -312,6 +312,11 @@ private async Task> GetUserRoomsWithRoleAsync(Guid user } } + if (!isDocSpaceAdmin) + { + return result; + } + var virtualRoomsFolderId = await _globalFolder.GetFolderVirtualRoomsAsync(_daoFactory); var archiveFolderId = await _globalFolder.GetFolderArchiveAsync(_daoFactory);