Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/whatsnew #123

Merged
merged 1 commit into from
Dec 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions products/ASC.Files/Core/Configuration/ProductEntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ public override async Task<IEnumerable<ActivityInfo>> 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<ActivityInfo>();

foreach (var e in events)
Expand Down Expand Up @@ -290,7 +290,7 @@ public override string Description
public override ProductContext Context => _productContext;
public override string ApiURL => string.Empty;

private async Task<Dictionary<string, bool>> GetUserRoomsWithRoleAsync(Guid userId)
private async Task<Dictionary<string, bool>> GetUserRoomsWithRoleAsync(Guid userId, bool isDocSpaceAdmin)
{
var result = new Dictionary<string, bool>();

Expand All @@ -312,6 +312,11 @@ private async Task<Dictionary<string, bool>> GetUserRoomsWithRoleAsync(Guid user
}
}

if (!isDocSpaceAdmin)
{
return result;
}

var virtualRoomsFolderId = await _globalFolder.GetFolderVirtualRoomsAsync(_daoFactory);
var archiveFolderId = await _globalFolder.GetFolderArchiveAsync(_daoFactory);

Expand Down
Loading