Check for unit access before querying database