The User Portal shows the user the statistics for the nodes they manage, but not for everybody else's nodes. In order to do this, we rely on the node's contact to be an e-group (mailing list) or a user's email. We then filter all the data using the filter_contacts and filter_nodes macros defined in druid_utils/default/macros.conf.
These macros use the contactinfo lookup table, which contains the list of user names that are members of each e-group listed as a contact. This lookup table, like most others, is generated regularly by a saved search in druid_utils/default/savedsearches.conf. The members of an e-group are extracted from ldap by druid_utils/bin/ldaplookup.py.