[wp-trac] [WordPress Trac] #31183: Users with "update_plugins" capability can not see update details

WordPress Trac noreply at wordpress.org
Wed Feb 11 04:42:47 UTC 2015


#31183: Users with "update_plugins" capability can not see update details
---------------------------------+-----------------------------
 Reporter:  michel.weimerskirch  |       Owner:
     Type:  defect (bug)         |      Status:  new
 Priority:  normal               |   Milestone:  4.2
Component:  Plugins              |     Version:  4.1
 Severity:  normal               |  Resolution:
 Keywords:  has-patch            |     Focuses:  administration
---------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * keywords:  needs-patch => has-patch


Comment:

 Replying to [comment:5 prasoon2211]:
 > Should I file a bug for this or is this expected behaviour? Also, if
 this is expected behaviour, how would I go about removing a capability
 from a user (since remove_cap doesn't seem to be working in this case)?

 Not sure about the `remove_cap()` bug you've encountered, but
 `'map_meta_cap'` filter works for me:
 {{{
 function wp31183_remove_install_plugins_capability( $caps, $cap, $user_id,
 $args ) {
         if ( 'install_plugins' === $cap ) {
                 $caps[] = 'do_not_allow';
         }

         return $caps;
 }
 add_filter( 'map_meta_cap', 'wp31183_remove_install_plugins_capability',
 10, 4 );
 }}}

 I've tested [attachment:31183.diff], and it fixes the issue. Would like a
 second look from another committer.

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


More information about the wp-trac mailing list