Function to get all the user permissions Is there a Drupal 7 function that lists all the user permissions defined from enabled modules?

What I need for a module I am implementing is getting all the permissions and adding to each one a checkbox list.

Is it possible to make the value of the checkbox the same shown in the "permission" column of the "role_permission" table?
There is a Drupal function for that, user_permission_get_modules(), which returns an associative array, whose keys are the permissions and values are the modules that define those permissions.

If you only need the permissions without the module names, you can use array_keys:

$permissions = user_permission_get_modules();
$permissions = array_keys($permissions);