WordPress.org

Making WordPress.org


Ignore:
Timestamp:
05/06/2016 06:56:40 PM (3 years ago)
Author:
obenland
Message:

Plugin Directory: Allow Committers and Reviewers to edit_others_posts.

WordPress seems to require users to have that capability globally for a post
type, in order to make changes to others posts, even if it's only certain
others posts.

This switches to using plugin_review and plugin_approve capabilities to
control Reviewers and Committers access to certain plugins. It also improves
the logic for displaying links to the various post status views in the plugins
list table.

See #1570.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-capabilities.php

    r3080 r3093  
    3838
    3939                } else {
    40                     if ( 'pending' == $post->post_status ) {
    41                         $required_caps[] = 'plugin_edit_pending';
     40
     41                    if ( in_array( $post->post_status, array( 'draft', 'pending' ) ) ) {
     42                        $required_caps[] = 'plugin_review';
    4243
    4344                    } else {
    44                         $required_caps[] = 'plugin_edit_others';
     45                        $required_caps[] = 'plugin_approve';
    4546                    }
    4647                }
     
    7879            'plugin_set_tags' => true,
    7980            'plugin_add_committer' => true,
     81            'plugin_edit_others' => true,
    8082        );
    8183
     
    8688
    8789        $admin = array_merge( $reviewer, array(
    88             'plugin_add_committer' => true,
    89             'plugin_edit_others' => true,
    9090            'plugin_approve' => true,
    9191            'plugin_reject' => true,
Note: See TracChangeset for help on using the changeset viewer.