[wp-hackers] Breaking down the Edit_Pages capability

Chris Casciano chris at placenamehere.com
Sun Jan 22 15:52:03 GMT 2006


On Jan 22, 2006, at 9:31 AM, Owen Winkler wrote:

> Andy Skelton wrote:
>> On 1/21/06, Chris Casciano <chris at placenamehere.com> wrote:
>>> If there are new pages to be created that would be the call and
>>> responsibility of someone higher up the food chain.
>
> http://trac.wordpress.org/ticket/2301
>
> Includes a plugin for 2.0 and a potential patch on 2.0 to add a new 
> capability "edit_others_pages" that might interest you.  Specifically, 
> if you do not have this capability, then you can't edit the pages of 
> others.
>
> It might not be exactly the solution, but I would be interested in 
> seeing any alterations that allowed users with "edit_others_pages" to 
> edit existing pages without allowing them to create new ones 
> themselves.
>

I saw that and think I mentioned it in my initial post.

I guess what I'm getting at is does someone (I?) need to file another 
bug to get these other options (say a create_pages along side of 
edit_pages and the coming edit_others_pages) rest of that post 
granularity mirrored in the pages capabilities set or is there some 
valid reason that road hasn't been taken.

>
> Also, you can easily remove menus from the admin without buffering by 
> hooking admin_menu, using $menu/$submenu as a global, checking for the 
> conditions of display, then unset() the appropriate core menu item.
>
> add_action('admin_menu', 'my_admin_menu');
> function my_admin_menu() {
> 	global $submenu;
> 	if(!current_user_can('some_new_capability')) {
> 		unset($submenu['post.php'][10]);
> 	}
> }
>
>
> And finally, a rule of thumb:  NEVER check anything against a role 
> name.  ALWAYS use a capability.  Why?  Capability names are not 
> translated (__('Administrator') != 'Administrator'), and are not 
> designed to be potentially deleted.
>

Aye, thanks all for the code snippets so far - and keep em coming if 
you have any other ideas. Some time this week I'll get my hands dirty 
and really look at the cleanest way to get where I want in the short 
term.

-- 
[ Chris Casciano ]
[ chris at placenamehere.com ] [ http://placenamehere.com ]



More information about the wp-hackers mailing list