TEZ-1683. Do ugi::getGroups only when necessary when checking ACLs. (hitesh)