This is generally an internal UserSpice function and is not usually used by developers.
<?php $data = fetchUserPermissions(2); ?>
Will return an array of objects. Each object will contain the id in the table user_permission_matches, the permission id, and the user id of the user with that permission level.
So, if you have a user with 10 permission levels, you will get an array of 10 objects.