Ticket #3164: 3164.patch
| File 3164.patch, 2.0 KB (added by , 8 years ago) |
|---|
-
src/includes/replies/capabilities.php
136 136 if ( bbp_is_user_inactive( $user_id ) ) { 137 137 $caps = array( 'do_not_allow' ); 138 138 139 // User is author so allow edit if not in admin 139 // User is author so allow edit if not in admin, unless it's past edit lock time 140 140 } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) { 141 $caps = array( $post_type->cap->edit_posts ); 141 if ( ! bbp_past_edit_lock( $_post->post_date_gmt ) ) { 142 $caps = array( $post_type->cap->edit_posts ); 143 } elseif ( user_can( $user_id, 'moderate', $_post->ID ) ) { 144 $caps = array( 'spectate' ); 145 } else { 146 $caps = array( 'do_not_allow' ); 147 } 142 148 143 149 // Moderators can always edit forum content 144 150 } elseif ( user_can( $user_id, 'moderate', $_post->ID ) ) { -
src/includes/topics/capabilities.php
156 156 if ( bbp_is_user_inactive( $user_id ) ) { 157 157 $caps = array( 'do_not_allow' ); 158 158 159 // User is author so allow edit if not in admin 159 // User is author so allow edit if not in admin, unless it's past edit lock time 160 160 } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) { 161 $caps = array( $post_type->cap->edit_posts ); 161 if ( ! bbp_past_edit_lock( $_post->post_date_gmt ) ) { 162 $caps = array( $post_type->cap->edit_posts ); 163 } elseif ( user_can( $user_id, 'moderate', $_post->ID ) ) { 164 $caps = array( 'spectate' ); 165 } else { 166 $caps = array( 'do_not_allow' ); 167 } 162 168 163 169 // Moderators can always edit forum content 164 170 } elseif ( user_can( $user_id, 'moderate', $_post->ID ) ) {