def GetRequiredResolveAccess(self, attribute_prefix):
    """Returns required level of access for resolve operations.

    Args:
      attribute_prefix: A string (single attribute) or a list of
                        strings (multiple attributes).

    Returns:
      "r" when only read access is needed for resolve operation to succeed.
      Read operation allows reading the object when its URN is known.
      "rq" when both read and query access is needed for resolve operation to
      succeed. Query access allows reading indices, and thus traversing
      trees of objects (see AFF4Volume.ListChildren for details).
    """

    if isinstance(attribute_prefix, basestring):
      attribute_prefix = [utils.SmartStr(attribute_prefix)]
    else:
      attribute_prefix = [utils.SmartStr(x) for x in attribute_prefix]

    for prefix in attribute_prefix:
      if not prefix:
        return "rq"

      # Extract the column family
      try:
        column_family, _ = prefix.split(":", 1)
      except __HOLE__:
        raise RuntimeError("The attribute prefix must contain the column "
                           "family: %s" % prefix)

      # Columns with index require the query permission.
      if column_family.startswith("index"):
        return "rq"

    return "r"
dataset/ETHPy150Open google/grr/grr/lib/data_store.py/DataStore.GetRequiredResolveAccess