Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to do as follows:

  • All users can edit all posts from other authors (sort of wiki)
  • Some posts have an "owner". When owner is specified only this user can edit the post.

Do you have any suggestions for this kind of permission settings?

share|improve this question
    
What do you mean by "owner"? Every post has an author so I don't think that is what you mean. You scheme would not work if it were since everything would be "owned". –  s_ha_dum Mar 12 '13 at 20:14
    
Sorry for not explaining it well. "Owned" is a flag I will add to my custom post type via custom field (just for some posts). This kind of post has a specified author that will be the only able to edit the post. All the "non-owned" submitted posts should not be associated to a specific author (maybe all associated with admin or similar) and be editable by everyone. –  Andycap Mar 13 '13 at 9:07
add comment

1 Answer

Actually I got it, just needed some simple logic.

If the post has an "owner" (the only person that can edit the post) I manually set the custom field "owned" to 1 and the author as the one that can edit.

On the edit post page (I'm doing it front-end) I check if "owned" custom field is = 1 and the author is = current user then I show the edit form. If not, I display a message. If the custom field "owned" is = 0, then I display the edit form so everyone can edit.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.