public override Task OnConnectedAsync() { Groups.AddToGroupAsync(Context.ConnectionId, _identityProvider.GetRole()); Groups.AddToGroupAsync(Context.ConnectionId, _identityProvider.GetUserId()); return(base.OnConnectedAsync()); }
private static bool IsIdentityRoleAllowed(string allowedRoles, IIdentityProvider identityProvider) { return(allowedRoles .Split(RoleSeparator) .FirstOrDefault(role => role.Trim() == identityProvider.GetRole()) != default); }