def community_kwargs_from_role(role):
    """Parses community id and role from role name."""
    args = role.name.split(':')
    if args[0] != 'community' or len(args) != 3:
        return None

    return dict(
        id_=args[1],
        role=args[2]
    )