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

Muro, Matthew mmuro at advance.ua.edu
Wed Mar 9 01:32:35 UTC 2011


I've written a tutorial on how to do such a thing with the Members plugin.

http://webtide.wordpress.com/2010/07/20/how-to-use-the-members-plugin-to-restrict-access-to-wordpress-3-0-custom-post-type/

Good luck,

Matthew Muro


On Mar 8, 2011, at 6:10 PM, <wp-hackers-request at lists.automattic.com<mailto:wp-hackers-request at lists.automattic.com>> wrote:

Message: 4
Date: Tue, 8 Mar 2011 16:56:03 -0500
From: "David F. Carr" <david at carrcommunications.com<mailto:david at carrcommunications.com>>
Subject: [wp-hackers] Adding editing rights for specific posts in a
       custom  post type
To: wp-hackers <wp-hackers at lists.automattic.com<mailto:wp-hackers at lists.automattic.com>>
Message-ID:
       <AANLkTimTPmuq_jCAexic+08OFVAw4R9bgbGAsNSnsoFE at mail.gmail.com<mailto:AANLkTimTPmuq_jCAexic+08OFVAw4R9bgbGAsNSnsoFE at mail.gmail.com>>
Content-Type: text/plain; charset=ISO-8859-1

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<mailto:david at carrcommunications.com>
Writer, Editor, Web Consultant
Forbes.com<http://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