Check for no matching tasks in search.

Explicitly check for the condition where no tasks are authorized for
viewing by the search user. Only call the function to retrieve task
metadata if there is at least one matching task ID authorized for
viewing.