예제 #1
0
def customer_match(user, groups):
    if role(user) == "admin":
        return None
    else:
        match = db.get_customer_by_match([user] + groups)
        if match:
            return match
        else:
            raise NoCustomerMatch
예제 #2
0
파일: auth.py 프로젝트: tdi/alerta
def customer_match(user, groups):
    if role(user) == 'admin':
        return None
    else:
        match = db.get_customer_by_match([user] + groups)
        if match:
            return match
        else:
            raise NoCustomerMatch
예제 #3
0
파일: auth.py 프로젝트: spy19930412/alerta
def customer_match(user, groups):
    if 'admin' in scopes(user, groups):
        return None
    else:
        match = db.get_customer_by_match([user] + groups)
        if match:
            if match == '*':
                return None
            return match
        else:
            raise NoCustomerMatch