示例#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
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