Skip to:
Content
Pages
Categories
Search
Top
Bottom

Possible Bug: Admin 'Trash' link and URE

  • @emcniece

    Member

    I’m debugging a site right now and trying to get the “trash” link to show up for Subscribers as well as admins. This is a fresh install of WP 3.3.2, URE and bbPress 2.0.2. Despite checking the “delete_replies” box in User Role Editor, the link still does not show up for Subscribers!

    Digging deeper: line 1370 of bbp-reply-template.php shows this:

    if ( !current_user_can( 'delete_reply', $r ) && !empty( $r ) )

    unset( $r );

    … which is good – checks for permission, and if the user doesn’t have ‘delete_reply’ on $r node then it unsets the delete link.

    So why does the URE checkbox not enable this link? Looking at an unserialized string of user capabilities for the current Subscriber role shows this:

    ...

    'subscriber' =>

    array (

    'name' => 'Subscriber',

    'capabilities' =>

    array (

    'assign_topic_tags' => 1,

    'delete_replies' => 1,

    'delete_topics' => 1,

    'edit_replies' => 1,

    'level_0' => 1,

    'publish_replies' => 1,

    'publish_topics' => 1,

    'read' => 1,

    ),

    ),

    ...

    and we see here that the capability showing is ‘delete_replies’, NOT ‘delete_reply’!!

    So all that needs to be done to fix this is adding another capability in URE that lists as ‘delete_reply’ instead of ‘delete_replies’. Easy fix!

    Here’s the disclaimer: there are a ton of plugins installed right now, so I’m not even sure ‘delete_replies’ permission is part of bbPress. If bbPress indeed does not add its own delete permission, then this is NOT a bug – just an interesting quirk!

  • You must be logged in to reply to this topic.
Skip to toolbar