def CheckFlowAuthorizedLabels(token, flow_name):
 flow_cls = flow.GRRFlow.GetPlugin(flow_name)
 if flow_cls.AUTHORIZED_LABELS:
  return CheckUserForLabels(token.username, flow_cls.AUTHORIZED_LABELS, token=token)
 else:
  return True

def CheckFlowAuthorizedLabels ( token , flow_name ) : flow_cls = flow . GRRFlow . GetPlugin ( flow_name ) if flow_cls . AUTHORIZED_LABELS : return CheckUserForLabels ( token . username , flow_cls . AUTHORIZED_LABELS , token = token ) else : return True
checks if user has a label in flows authorized_labels list .