← All changes
|
modules/api-backups/classes/class-api-backups-overview.php
+6
-4
5.1
→
6.2.1
View file →
| @@ -9,10 +9,12 @@ | ||
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | namespace MainWP\Dashboard\Module\ApiBackups; |
| 12 | 12 | |
| 13 | -use function MainWP\Dashboard\mainwp_current_user_have_right; | |
| 14 | -use function MainWP\Dashboard\mainwp_do_not_have_permissions; | |
| 13 | +// Exit if accessed directly. | |
| 14 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 15 | + exit; | |
| 16 | +} | |
| 15 | 17 | |
| 16 | 18 | /** |
| 17 | 19 | * MainWP API Backups Overview |
| 18 | 20 | */ |
| @@ -110,10 +112,10 @@ | ||
| 110 | 112 | * Render backups list. |
| 111 | 113 | */ |
| 112 | 114 | public function render_backups_list() { |
| 113 | 115 | |
| 114 | - if ( ! mainwp_current_user_have_right( 'dashboard', 'manage_api_backups' ) ) { | |
| 115 | - mainwp_do_not_have_permissions( esc_html__( 'manage api backups', 'mainwp' ) ); | |
| 116 | + if ( ! \mainwp_current_user_can( 'dashboard', 'manage_api_backups' ) ) { | |
| 117 | + \mainwp_do_not_have_permissions( esc_html__( 'manage api backups', 'mainwp' ) ); | |
| 116 | 118 | return; |
| 117 | 119 | } |
| 118 | 120 | Api_Backups_Admin::render_header(); |
| 119 | 121 | ?> |