[wp-trac] [WordPress Trac] #29789: Bulk Actions Selectbox is displayed even when user can't edit or trash anything

WordPress Trac noreply at wordpress.org
Mon Aug 24 05:41:08 UTC 2015


#29789: Bulk Actions Selectbox is displayed even when user can't edit or trash
anything
-----------------------------------+---------------------------------
 Reporter:  psoluch                |       Owner:  wonderboymusic
     Type:  enhancement            |      Status:  reopened
 Priority:  normal                 |   Milestone:  4.4
Component:  Posts, Post Types      |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch ux-feedback  |     Focuses:  ui, administration
-----------------------------------+---------------------------------
Changes (by DeBAAT):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Sorry, just saw the changeset passing on my twitter timeline and don't
 know how to comment on that changeset. So I try to get my point across
 over here.

 Personally, I think it is wrong to check for 'edit_posts' when you are
 deleting a post.

 I agree, the check for 'delete_posts' should be implemented correctly.
 There might be situations where a user is not allowed to edit_posts but
 may absolutely delete_posts.

 I don't know exactly how to produce a diff, but my suggestion would be to
 have the check implemented as follows, starting from line 285:


 {{{
         if ( current_user_can( $post_type_obj->cap->edit_posts ) ) {
                 if ( $this->is_trash ) {
                         $actions['untrash'] = __( 'Restore' );
                 } else {
                         $actions['edit'] = __( 'Edit' );
                 }
         }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29789#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list