How can I override the get_user_permissions function in Frappe

In frappe there is core module called get_user_permissions

Now i need to create my own module or function(get_user_permissions) where i can send the values which are required to get_user_permissions so that frappe should not to use core get_user_permissions

Class method then check it.

whitelist method, then check the below example.