Beispiel #1
0
def get(team_id):

    """
    Verify the logged in user has access to the requested team and return that teams list of domains.
    :param team_id:
    :return: List of domain objects for the team
            [{'id':domain_id,'name','name':domainname,'description':domaindescription},..]
    """

    user = helper.get_user()

    if not db.hasTeamAccess(user.get_email(),team_id):
        tangelo.content_type()
        tangelo.http_status(401)
        tangelo.log("401 Unauthorized domains/?team_id="+str(team_id)+" user: "******"401 Unauthorized"
    else:
        results = db.get_domains(team_id)
        return json.dumps(results)
Beispiel #2
0
def get(team_id):
    """
    Verify the logged in user has access to the requested team and return that teams list of domains.
    :param team_id:
    :return: List of domain objects for the team
            [{'id':domain_id,'name','name':domainname,'description':domaindescription},..]
    """

    user = helper.get_user()

    if not db.hasTeamAccess(user.get_email(), team_id):
        tangelo.content_type()
        tangelo.http_status(401)
        tangelo.log("401 Unauthorized domains/?team_id=" + str(team_id) +
                    " user: "******"401 Unauthorized"
    else:
        results = db.get_domains(team_id)
        return json.dumps(results)
Beispiel #3
0
def get_domains(*args):
    domains = db.get_domains()
    return json.dumps(map(lambda x: dict(name=x[0], description=x[1]), domains))
Beispiel #4
0
def get():
    results = db.get_domains()
    results = map(lambda x: {'name': x[0], 'description': x[1]}, results)
    return json.dumps(results)
Beispiel #5
0
def get_domains(*args):
    domains = db.get_domains()
    return json.dumps(map(lambda x: dict(name=x[0], description=x[1]), domains))
def get():
    results = db.get_domains()
    results = map(lambda x: {"name": x[0], "description": x[1]}, results)
    return json.dumps(results)