[wp-hackers] Adding editing rights for specific posts in a custom post type

David F. Carr david at carrcommunications.com
Tue Mar 8 21:56:03 UTC 2011


I'd like to replicate some functionality from an older website I have on top
of WordPress, but it's going to require some modification of the default way
WordPress handles post editing rights.

On the old site, I have an event listing system where multiple officers of
an organization can share editing rights to an event posting. Everyone has
the right to edit their own posts, but members of a group can edit each
other's posts.

I have a WordPress plugin called RSVPMaker that has some nicer functionality
for event management, but I need to figure out how to retrofit this other
functionality onto it. RSVPMaker events are tracked through a custom post
type, so what I want to do is allow selected users to edit each other's
posts without making them editors with access to all posts. How do I hook
into the WordPress access rights system?

In pseudocode, what I want to implement is

if (user is trying to edit or post an edit AND post type=='rsvpmaker')
  if(user owns post OR user has group access rights)
     allow access
  else
     refuse access

Suggestions?

-- 
David F. Carr
david at carrcommunications.com
Writer, Editor, Web Consultant
Forbes.com Technology Blog http://blogs.forbes.com/davidcarr/
LinkedIn - http://www.linkedin.com/in/davidfcarr
Carr Communications Inc.- http://www.carrcommunications.com/
Facebook - http://www.facebook.com/carrcomm


More information about the wp-hackers mailing list