def check_acls(user, obj, acl_type):
 if (acl_type == 'moz_contact'):
  try:
   return (user.email in obj.addon.get_mozilla_contacts())
  except AttributeError:
   try:
    return (user.email in obj.thread.addon.get_mozilla_contacts())
   except AttributeError:
    return False
 elif (acl_type == 'admin'):
  return acl.action_allowed_user(user, 'Admin', '%')
 elif (acl_type == 'reviewer'):
  return (acl.action_allowed_user(user, 'Apps', 'Review') or acl.action_allowed_user(user, 'ContentTools', 'AddonReview'))
 elif (acl_type == 'senior_reviewer'):
  return acl.action_allowed_user(user, 'Apps', 'ReviewEscalated')
 else:
  raise Exception('Invalid ACL lookup.')
 return False

def check_acls ( user , obj , acl_type ) : if ( acl_type == 'moz_contact' ) : try : return ( user . email in obj . addon . get_mozilla_contacts ( ) ) except AttributeError : try : return ( user . email in obj . thread . addon . get_mozilla_contacts ( ) ) except AttributeError : return False elif ( acl_type == 'admin' ) : return acl . action_allowed_user ( user , 'Admin' , '%' ) elif ( acl_type == 'reviewer' ) : return ( acl . action_allowed_user ( user , 'Apps' , 'Review' ) or acl . action_allowed_user ( user , 'ContentTools' , 'AddonReview' ) ) elif ( acl_type == 'senior_reviewer' ) : return acl . action_allowed_user ( user , 'Apps' , 'ReviewEscalated' ) else : raise Exception ( 'Invalid ACL lookup.' ) return False
check acls .