Beispiel #1
0
def company_acl_verify(username: str, company: Company):
    if username in company.get_company_acl():
        return True

    raise HTTPForbidden(
        'Unauthorized',
        'Provided Token credentials does not have sufficient permissions to access resource'
    )
Beispiel #2
0
def fmt_company(company: Company):
    return "{} ({}) - acl: {}".format(company.get_company_name(),
                                      company.get_company_id(),
                                      company.get_company_acl())