Title: Improve Capabilities
Last modified: January 13, 2022

---

# Improve Capabilities

 *  [i4nd90](https://wordpress.org/support/users/i4nd90/)
 * (@i4nd90)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/improve-capabilities/)
 * In PostFactory.php there are these line:
    `if ( !current_user_can('publish_posts'))
   return;`
 * This shouldn’t always be the case in my opinion – I have a workflow which enables
   some users to make drafts (and set other custom statuses) and others who can 
   publish. It would be great if the code could first check the desired status of
   the post before checking what capabilities apply – and returning the correct 
   error if the check fails. Currently a JS error is created because new_pages returns
   null from the admin-ajax call, despite a success flag.
    -  This topic was modified 4 years, 4 months ago by [i4nd90](https://wordpress.org/support/users/i4nd90/).
    -  This topic was modified 4 years, 4 months ago by [i4nd90](https://wordpress.org/support/users/i4nd90/).

The topic ‘Improve Capabilities’ is closed to new replies.

 * ![](https://ps.w.org/wp-nested-pages/assets/icon-128x128.png?rev=1690043)
 * [Nested Pages](https://wordpress.org/plugins/wp-nested-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-nested-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-nested-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-nested-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-nested-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-nested-pages/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [i4nd90](https://wordpress.org/support/users/i4nd90/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/improve-capabilities/)
 * Status: not resolved