I run a membership site, and needed to restrict access by group.
Someone may tell me to read the source, but I did not have time, so I searched first.
At first I looked at the Xoops technical-information wiki, but found nothing useful, so I asked Google.
As a result, I found the following site.

Obtaining Logged-In User Information_XOOPS

Ah, what a good age we live in.