[wp-hackers] Trouble while Adding Caps to WP

Computer Guru computerguru at neosmart.net
Sun Jul 30 18:42:04 GMT 2006


I changed 'upgrade-schemas.php' from

	// Add caps for Administrator role
	$role = get_role('administrator');
	$role->add_cap('switch_themes');
	$role->add_cap('edit_themes');
	$role->add_cap('activate_plugins');

To

	// Add caps for Administrator role
	$role = get_role('administrator');
	$role->add_cap('switch_themes');
	$role->add_cap('edit_themes');
	$role->add_cap('activate_plugins');
	$role->add_cap('manage_plugins');

And ran upgrade.php

However, when I call this function:

if (!current_user_can('manage_plugins'))
	wp_die('<p>'.__('You do not have sufficient permissions to edit
plugins for this blog.').'</p>');

while logged in as 'admin' I get the not enough permissions error.


Am I doing something wrong? AFAIK, caps are listed in 'upgrade-schemas.php'
and are saved to the db by running upgrade.php.... but it's not working.

Any advice?

Computer Guru
NeoSmart Technologies
http://neosmart.net/blog/





More information about the wp-hackers mailing list