Skip to:
Content

bbPress.org

Changeset 5852


Ignore:
Timestamp:
07/15/2015 10:27:42 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Capabilities: add delete_posts mappings to delete topic & reply checks.

This changeset ensures that capable users can delete their own topics & replies, when these capabilities are explicitly allowed already.

Props netweb, gusrb84. Fixes #2685.

Location:
trunk/src/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/replies/capabilities.php

    r5834 r5852  
    166166                    $caps[] = 'moderate';
    167167
     168                // User is author so allow edit if not in admin
     169                } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {
     170                    $caps[] = $post_type->cap->delete_posts;
     171
    168172                // Unknown so map to delete_others_posts
    169173                } else {
  • trunk/src/includes/topics/capabilities.php

    r5834 r5852  
    188188                    $caps[] = 'moderate';
    189189
     190                // User is author so allow edit if not in admin
     191                } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {
     192                    $caps[] = $post_type->cap->delete_posts;
     193
    190194                // Unknown so map to delete_others_posts
    191195                } else {
Note: See TracChangeset for help on using the changeset viewer.