Wordpress 1.6 introduced role-based user management. wp_roles global variable stores the different roles Wordpress user can have. It is an instance of class WP_Roles defined in [wordpress root folder]/wp-includes/capabilities.php and is set in [wordpress root folder]/wp-settings.php.
Ryan Boren has a detailed post regarding this. WP_Roles provides following methods:
WP_Roles(): the constructoradd_role($role, $display_name, $capabilities=''): adds specified roleremove_role($role): removes specified roleadd_cap($role, $cap, $grant = true): adds specified capability to the specified roleremove_cap($role, $cap): removes specified capability from the specified roleget_role($role): returns specified roleget_names(): returns list of names of all the rolesis_role($role): queries if the specified role exists or not
Plugin authors can work with following wrapper functions that operate on the global variable for roles and capabilities management:
get_role($role)add_role($role, $display_name, $capabilities='')remove_role($role)
$role can be any of the capabilities provided by default (check here), e.g., it can be ‘administrator’, ‘contributor’, …
To manage capabilities of a role, following methods of class WP_Role can be used after acquiring a role by using get_role($role):
WP_Role($role, $capabilities)add_cap($cap, $grant = true): adds capabilitiesremove_cap($cap, $grant = true): removes capabilitieshas_cap($cap): queries for a specific capability
WP_User can be use to manage a specific user’s roles and capabilities. $current_user_can($capability) can be used to query the current user’s capabilities.
Back to full list of global variables.
Technorati tags: wp_roles, wp_user, roles, capabilities

April 12th, 2006 at 10:20 pm
[...] Optionally, unfiltered_html capability can be added to disable the default filtering of HTML elements specified in [wordpress root folder]/wp-includes/kses.php. Plugins can be written to add custom functions for the filter init to allow your set of HTML elements. unfiltered_html setting should be carefully enabled as it can allow posting of malicious code. [...]
April 12th, 2006 at 10:26 pm
[...] $wp_roles [...]
November 24th, 2006 at 2:19 pm
[...] User Data: wp_roles, user_pass_md5, user_url, user_login, user_level, user_identity, user_email, user_ID, current_user, and wpdb [...]