Index: modules/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user.module,v retrieving revision 1.608 diff -u -F^f -r1.608 user.module --- modules/user.module 17 Apr 2006 20:48:26 -0000 1.608 +++ modules/user.module 21 Apr 2006 15:19:25 -0000 @@ -1673,6 +1674,12 @@ function user_admin_access() { return $output; } +/** + * Use this API to retreive an array of all available roles + * @param $membersonly Set this to TRUE to omit the special role 'anonymous'. + * @param $permission A string containing a permission. If set, only roles that have that permission are returned. + * @return An associative array, with the role id as key and the role name as value. + **/ function user_roles($membersonly = 0, $permission = 0) { $roles = array();