'Determine if the current user is member of the given channel_id
:param channel_id : the channel_id to check'

@http.route(['/groups/is_member'], type='json', auth='public', website=True)
def is_member(self, channel_id=0, **kw):

    current_user = request.env.user
    session_partner_id = request.session.get('partner_id')
    public_user = request.website.user_id
    partner = None
    if (current_user != public_user):
        partner = current_user.partner_id
    elif session_partner_id:
        partner = request.env['res.partner'].sudo().browse(session_partner_id)
    values = {'is_user': (current_user != public_user), 'email': (partner.email if partner else ''), 'is_member': False, 'alias_name': False}
    channel = request.env['mail.channel'].browse(int(channel_id))
    if (channel.exists() and (partner is not None)):
        values['is_member'] = bool((partner in channel.sudo().channel_partner_ids))
    return values
