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 flow's authorized_labels list.
dataset/ETHPy150Open google/grr/grr/lib/aff4_objects/user_managers.py/CheckFlowAuthorizedLabels