Changeset 6713
- Timestamp:
- 09/21/2017 02:18:40 AM (8 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 2 edited
-
replies/capabilities.php (modified) (2 diffs)
-
topics/capabilities.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/capabilities.php
r6667 r6713 137 137 $caps = array( 'do_not_allow' ); 138 138 139 // User is author so allow edit if not in admin140 } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {141 $caps = array( $post_type->cap->edit_posts );142 143 139 // Moderators can always edit forum content 144 140 } elseif ( user_can( $user_id, 'moderate', $_post->ID ) ) { 145 141 $caps = array( 'spectate' ); 146 142 143 // Allow author or mod to edit if not in admin, unless past edit lock time 144 } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) { 145 146 // Only allow if not past the edit-lock period 147 $caps = ! bbp_past_edit_lock( $_post->post_date_gmt ) 148 ? array( $post_type->cap->edit_posts ) 149 : array( 'do_not_allow' ); 150 147 151 // Fallback to edit_others_posts. 148 152 } else { … … 168 172 $caps = array( 'do_not_allow' ); 169 173 174 // Moderators can always edit forum content 175 } elseif ( user_can( $user_id, 'moderate', $_post->ID ) ) { 176 $caps = array( 'spectate' ); 177 170 178 // User is author so allow delete if not in admin 171 179 } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) { 172 180 $caps = array( $post_type->cap->delete_posts ); 173 181 174 // Moderators can always edit forum content175 } elseif ( user_can( $user_id, 'moderate', $_post->ID ) ) {176 $caps = array( 'spectate' );177 178 182 // Unknown so map to delete_others_posts 179 183 } else { -
trunk/src/includes/topics/capabilities.php
r6667 r6713 157 157 $caps = array( 'do_not_allow' ); 158 158 159 // User is author so allow edit if not in admin160 } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {161 $caps = array( $post_type->cap->edit_posts );162 163 159 // Moderators can always edit forum content 164 160 } elseif ( user_can( $user_id, 'moderate', $_post->ID ) ) { 165 161 $caps = array( 'spectate' ); 162 163 // User is author so allow edit if not in admin, unless it's past edit lock time 164 } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) { 165 166 // Only allow if not past the edit-lock period 167 $caps = ! bbp_past_edit_lock( $_post->post_date_gmt ) 168 ? array( $post_type->cap->edit_posts ) 169 : array( 'do_not_allow' ); 166 170 167 171 // Unknown, so map to edit_others_posts
Note: See TracChangeset
for help on using the changeset viewer.