Support » Plugins and Hacks » Document Repository » [Plugin: Document Repository] Editors Not Able to Edit Documents

[Plugin: Document Repository] Editors Not Able to Edit Documents

  • We’ve never had a reason to really invoke the Document Roles until recently, but now we’ve come across an issue with them.

    The original author of many of our documents left, and the people that filled in for that person (set as “Editors” in WordPress, assigned the same Document Role as the person that left) are not able to edit that person’s documents.

    The strange thing is, they can see and click the “Edit” link for the document post, and they can make changes to the title, content, etc.; but when they press the “Update” button, they get a WordPress error message that says “You are not allowed to edit posts as this user.”

    In addition, when an Editor with that document role tries to upload a new version of the document, it seems to stall out in the “Crunching” stage and never gets to the point where it’s “Finished”.

    I’m happy to dig around the code and try to work up a patch, but before doing that, I just wanted to make sure you didn’t have any suggestions as to where to start.

    I’m assuming that I’ll need to remove the fact that the post_type automatically maps meta caps, then use a process similar to what Justin Tadlock outlines in his tutorial to implement custom meta capabilities based on the value of the user’s document role; but I’m not sure.

    Do you have any thoughts? Thanks.


Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ron Rennick


    Was the original author deleted as a user?

    No, we never deleted the original author. That user still exists within the site and is still set as the author of the documents. That user has the same Document Role as the users that are trying to edit the documents, now. Thanks.

    Plugin Author Ron Rennick


    In the save_post hook, try commenting out the permission check. If that works try changing the permission being checked to edit_posts.

    I looked through the plugin, and the only place it hooks into the save_post hook is within the taxonomies portion. It doesn’t perform any permissions checks there.

    Further, the only places it appears to run its own permissions checks are within the init method (where it uses permissions to decide whether to show the admin menu item, and whether to add the post/user columns, etc.) and within the admin_bar_menu method (where it decides whether or not to show the “Documents” item in the admin bar).

    There don’t appear to be any permission checks within the plugin that can be altered, so it must be something about the process of mapping the meta caps.

    I’ll keep digging. Thanks, Ron.

    Plugin Author Ron Rennick


    Sorry, it’s not on the save_post in this plugin. The cap check is built into CPTs. Check http://plugins.trac.wordpress.org/browser/document-repository/trunk/user-roles.php?rev=482888#L187

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Document Repository] Editors Not Able to Edit Documents’ is closed to new replies.
Skip to toolbar