public virtual async Task GroupAcceptUserAsync(GroupAcceptUserDto groupAcceptUser)
        {
            var myGroupCard = await _userGroupStore
                              .GetUserGroupCardAsync(CurrentTenant.Id, groupAcceptUser.GroupId, CurrentUser.GetId());

            if (myGroupCard == null)
            {
                // 当前登录用户不再用户组
                throw new UserFriendlyException("");
            }
            if (!myGroupCard.IsGrant(nameof(ChatGroupAdmin.AllowAddPeople)))
            {
                // 当前登录用户没有加人权限
                throw new UserFriendlyException("");
            }
            await _userGroupStore
            .AddUserToGroupAsync(CurrentTenant.Id, groupAcceptUser.UserId, groupAcceptUser.GroupId, CurrentUser.GetId());
        }
Esempio n. 2
0
 public virtual async Task GroupAcceptUserAsync(GroupAcceptUserDto groupAcceptUser)
 {
     await _chatAppService.GroupAcceptUserAsync(groupAcceptUser);
 }