+ $publish = ! ( isset( $entry->draft ) && 'yes' == trim( $entry->draft ) );
+ $cap = ($publish) ? 'publish_posts' : 'edit_posts';
+
+ if ( !current_user_can($cap) )
+ $this->auth_required(__('Sorry, you do not have the right to edit/publish new posts.'));
+