Making WordPress.org

Changeset 3129


Ignore:
Timestamp:
05/13/2016 04:29:38 PM (9 years ago)
Author:
obenland
Message:

Plugin Directory: Give authors/committers a role on the site.

Disabled until capabilities have been properly reviewed.

See https://wordpress.slack.com/archives/meta/p1463104152001314
See #1571.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
2 edited

Legend:

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

    r3019 r3129  
    116116        update_post_meta( $plugin->ID, 'assets_banners_color', wp_slash( $banner_average_color ) );
    117117
     118        // Give committers a role on this site.
     119        foreach ( Tools::get_plugin_committers( $plugin_slug ) as $committer ) {
     120            // @todo: Enable.
     121            continue;
     122            $user = get_user_by( 'slug', $committer );
     123
     124            if ( ! user_can( $user, 'plugin_dashboard_access' ) ) {
     125                $user->add_role( 'plugin_committer' );
     126            }
     127        }
    118128    }
    119129
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php

    r3035 r3129  
    159159        // Passed all tests!
    160160        // Let's save everything and get things wrapped up.
     161
     162        // Give the author wp-admin access if they don't have it yet.
     163        // @todo: Enable.
     164        if ( ! current_user_can( 'plugin_dashboard_access' ) ) {
     165        //  wp_get_current_user()->add_role( 'plugin_committer' );
     166        }
    161167
    162168        // Create a new post on first-time submissions.
Note: See TracChangeset for help on using the changeset viewer.