This is generally an internal UserSpice function and is not usually used by developers.
<?php $perms = fetchAllPermissions();
dump($perms); ?>
returns an array of objects containing
id, permission name name for each permission level