[wp-hackers] Trouble while Adding Caps to WP

Dave W dabbaking at gmail.com
Sun Jul 30 19:30:52 GMT 2006


Did you check to make sure it was getting added to the database?

On 7/30/06, Computer Guru <computerguru at neosmart.net> wrote:
>
> 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/
>
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Dave W


More information about the wp-hackers mailing list