| @@ -297,12 +297,17 @@ | ||
| 297 | 297 | |
| 298 | 298 | /** |
| 299 | 299 | * Renders the Reports Earnings Graphs |
| 300 | 300 | * |
| 301 | + * @since 3.22.1 added permissions check | |
| 301 | 302 | * @since 1.0 |
| 302 | 303 | * @return void |
| 303 | 304 | */ |
| 304 | 305 | function give_reports_earnings() { |
| 306 | + if (!current_user_can('view_give_reports')){ | |
| 307 | + wp_die(__('You do not have permission to access this report', 'give'), __('Error', 'give'), ['response' => 403]); | |
| 308 | + } | |
| 309 | + | |
| 305 | 310 | ?> |
| 306 | 311 | <div class="tablenav top reports-table-nav"> |
| 307 | 312 | <h2 class="reports-earnings-title screen-reader-text"><?php _e( 'Revenue Report', 'give' ); ?></h2> |
| 308 | 313 | </div> |