[wp-hackers] User Capabilities

Mark Jaquith mark.wordpress at txfx.net
Fri Jul 1 06:05:18 GMT 2005


Ryan Boren wrote:

>// Don't let staff writers upload images.
>$staff->remove_cap('upload_image');
>
Sir, I $staff->remove_cap('to_you')

</bad-bad-joke>

With edit_posts, it would be good to be able to specify if the role can 
edit own posts only, own posts and posts of lower levels, own posts and 
posts of same level.

For instance,

$collaborators = $wp_roles->get_role('collaborators');
$collaborators->add_cap('edit_post_same_level');

Or something.  Sometimes you want people of the same level to be able to 
edit each others posts, and sometimes you don't.  This would mean that 
there would have to be some sort of way of specifying that certain 
groups are "higher up" than others.

P.S. I love the "natural language" feel of 
current_user_can('edit_posts');  Brilliant.



More information about the wp-hackers mailing list