mirror of
https://github.com/Govor-team/Govor.git
synced 2026-11-18 13:24:59 +00:00
Add primitive groups and required channel
Adds server-side group and channel management, private invitations, member moderation, avatar handling, and required-channel configuration. This change also introduces SignalR group profile/member notifications, updates registration to atomically join required channels, and adds EF migration and test coverage for group membership, permissions, and invitation expiry rules.
This commit is contained in:
@@ -28,8 +28,10 @@ public class AccesserToDownloadMediaService : IAccesserToDownloadMedia
|
||||
return media.OwnerType switch
|
||||
{
|
||||
MediaOwnerType.Avatar => true, // media.OwnerId == userId
|
||||
MediaOwnerType.GroupAvatar => await _dbContext.GroupMemberships
|
||||
.AnyAsync(gm => gm.GroupId == media.OwnerId && gm.UserId == userId && !gm.IsBanned),
|
||||
MediaOwnerType.GroupAvatar => await _dbContext.ChatGroups.AnyAsync(g => g.Id == media.OwnerId &&
|
||||
!_dbContext.GroupMemberships.Any(m => m.GroupId == g.Id && m.UserId == userId && m.IsBanned) &&
|
||||
((!g.IsPrivate && g.ImageId == mediaId) || _dbContext.GroupMemberships
|
||||
.Any(m => m.GroupId == g.Id && m.UserId == userId && !m.IsBanned))),
|
||||
|
||||
MediaOwnerType.Message => await _dbContext.MediaAttachments
|
||||
.AnyAsync(ma =>
|
||||
|
||||
Reference in New Issue
Block a user