There is no function that does that.
I don't think this is possible at all. Attribute rules work on the database level, and the database exists completely independent from any ArcGIS Project.
Hi,
I thought the same but I have found GetUser function which returns portal user info. So I hope it is not only one function independent from database.