Control IP or IP group to Browse Projects permission

There are many people in our company who want to control the extension of project browsing permissions.
They want to control project browsing permissions through code. People who are not in a fixed IP or IP group are not allowed to browse projects.
What I mean is whether browsing project permissions support extending to IP settings?
I want to know PermissionSchemeManager how to control browse projects. And I can write a piece of code to support IP or IPS.

Similar to the implementation of servicedesk, how to determine whether parameters can achieve the effect of controlling browsing project permissions.
We are in a hurry, how can we implement it through code?