User 1 (P1) - gets access. User2 (P2) - gives access. The procedure for granting access - P2 has a list of users to whom it gives access. There is a mechanism for adding and removing from the list. The profile page is of the User data type. And all user data is fetched from the page data. When you go to this page, the user whose profile will be viewed is transmitted. When the page loads, you need to check if the current user is in the profile owner’s user list.
1 Like