mirror of
https://github.com/Govor-team/Govor.git
synced 2026-11-16 20:56:03 +00:00
2e9d7e625e
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.
13 lines
529 B
C#
13 lines
529 B
C#
using Govor.Domain;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Govor.Application.Groups;
|
|
|
|
public static class GroupAccess
|
|
{
|
|
public static Task<bool> IsGroupAdministratorAsync(this GovorDbContext context, Guid groupId, Guid userId) =>
|
|
context.ChatGroups.AnyAsync(g => g.Id == groupId &&
|
|
context.GroupMemberships.Any(m => m.GroupId == groupId && m.UserId == userId && !m.IsBanned) &&
|
|
(g.OwnerUserId == userId || context.GroupAdmins.Any(a => a.GroupId == groupId && a.UserId == userId)));
|
|
}
|