Making WordPress.org

Changeset 11745


Ignore:
Timestamp:
04/05/2022 05:15:11 AM (3 years ago)
Author:
dd32
Message:

Plugin Directory: Introduce specific capabilities for various actions, rather than just using "edit access". Take two.

See #5654.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/inc/template-tags.php

    r10800 r11745  
    408408    $close_link      = false;
    409409
    410     if ( ! current_user_can( 'plugin_admin_edit', $post ) || 'publish' != $post->post_status ) {
     410    if ( ! current_user_can( 'plugin_self_close', $post ) ) {
    411411        return;
    412412    }
     
    440440    $post = get_post();
    441441
    442     if (
    443         ! current_user_can( 'plugin_admin_edit', $post ) ||
    444         'publish' != $post->post_status
    445     ) {
     442    if ( ! current_user_can( 'plugin_admin_edit', $post ) ) {
    446443        return;
    447444    }
     
    449446    echo '<h4>' . esc_html__( 'Transfer This Plugin', 'wporg-plugins' ) . '</h4>';
    450447
    451     if ( get_current_user_id() != $post->post_author ) {
     448    if ( ! current_user_can( 'plugin_self_transfer', $post ) ) {
    452449        $owner = get_user_by( 'id', $post->post_author );
    453450        /* translators: %s: Name of plugin owner */
     
    496493    $post = get_post();
    497494
    498     if (
    499         ! current_user_can( 'plugin_admin_edit', $post ) ||
    500         'publish' != $post->post_status
    501     ) {
     495    if ( ! current_user_can( 'plugin_manage_releases', $post ) ) {
    502496        return;
    503497    }
Note: See TracChangeset for help on using the changeset viewer.