Maybe someone has a better answer, but here are my 2 cents.
Access control in MODX is quite complex. I did not fin any direct method that can provide the list of contexts a user is authorised to.
One possible way, which might be sufficient for your case, is through the groups to which the user belongs. You could do a follows :
Step 1: If you look at the “mgr” context in the manager, you can find which groups have manager access, with the policy you think is necessary for access to the manager. To find this, go to the system menu (“cog menu”), select the “Contexts” option. Edit the Web context and go to the “Access permissions” tab.
Step 2: From this list, write down which groups have the access policy or policies that provide the manager access you require in your script.
Step 3: Find to which groups the user belongs using the getUsergroups() or getUserGroupNames() method of the $modx->user object. Determine if he belongs to one of the groups you have identified in step 2.
If you need to find also the groups authorised to the manager through the API, it can get more complex, depending on your exact requirement.
But as a starter, you could query modAccessContext (through an XPDO query) to find the list of groups authorised to the “mgr” context, and match this with the list of groups the user belongs to.