diff --git a/php/admin/about-page.php b/php/admin/about-page.php index b54d9cc2..60fd7985 100644 --- a/php/admin/about-page.php +++ b/php/admin/about-page.php @@ -18,7 +18,7 @@ function qsm_generate_about_page() { global $mlwQuizMasterNext; $version = $mlwQuizMasterNext->version; - if ( ! current_user_can( 'moderate_comments' ) ) { + if ( ! current_user_can( 'delete_others_qsm_quizzes' ) ) { return; } $tab_array = [ diff --git a/php/admin/addons-page.php b/php/admin/addons-page.php index 6c055261..00c81c5b 100644 --- a/php/admin/addons-page.php +++ b/php/admin/addons-page.php @@ -10,7 +10,7 @@ * @since 4.4.0 */ function qmn_addons_page() { - if ( ! current_user_can( 'moderate_comments' ) ) { + if ( ! current_user_can( 'delete_others_qsm_quizzes' ) ) { return; } diff --git a/php/admin/admin-dashboard.php b/php/admin/admin-dashboard.php index b4f2eb7c..21895a48 100644 --- a/php/admin/admin-dashboard.php +++ b/php/admin/admin-dashboard.php @@ -102,7 +102,7 @@ function qsm_dashboard_screen_options( $status, $args ) { */ function qsm_generate_dashboard_page() { // Only let admins and editors see this page. - if ( ! current_user_can( 'edit_posts' ) ) { + if ( ! current_user_can( 'edit_qsm_quizzes' ) ) { return; } global $mlwQuizMasterNext; diff --git a/php/admin/stats-page.php b/php/admin/stats-page.php index 243d74fe..211dcd2d 100644 --- a/php/admin/stats-page.php +++ b/php/admin/stats-page.php @@ -16,7 +16,7 @@ * @return void */ function qmn_generate_stats_page() { - if ( ! current_user_can('moderate_comments') ) { + if ( ! current_user_can('delete_others_qsm_quizzes') ) { return; } global $mlwQuizMasterNext; diff --git a/php/admin/tools-page.php b/php/admin/tools-page.php index 472ede5e..70951f6b 100644 --- a/php/admin/tools-page.php +++ b/php/admin/tools-page.php @@ -15,7 +15,7 @@ * @since 6.2.0 */ function qsm_generate_quiz_tools() { - if ( ! current_user_can( 'moderate_comments' ) ) { + if ( ! current_user_can( 'delete_others_qsm_quizzes' ) ) { return; } add_meta_box( 'qsm_restore_box', 'Restore Quiz', 'qsm_restore_function', 'quiz_wpss' ); diff --git a/php/rest-api.php b/php/rest-api.php index bbb612a1..07c626cf 100644 --- a/php/rest-api.php +++ b/php/rest-api.php @@ -30,7 +30,7 @@ function qsm_register_rest_routes() { 'methods' => WP_REST_Server::CREATABLE, 'callback' => 'qsm_rest_create_question', 'permission_callback' => function () { - return current_user_can( 'edit_posts' ); + return current_user_can( 'edit_qsm_quizzes' ); }, ) ); @@ -41,7 +41,7 @@ function qsm_register_rest_routes() { 'methods' => WP_REST_Server::EDITABLE, 'callback' => 'qsm_rest_save_question', 'permission_callback' => function () { - return current_user_can( 'edit_posts' ); + return current_user_can( 'edit_qsm_quizzes' ); }, ) ); @@ -70,7 +70,7 @@ function qsm_register_rest_routes() { 'methods' => WP_REST_Server::EDITABLE, 'callback' => 'qsm_rest_save_results', 'permission_callback' => function () { - return current_user_can( 'edit_posts' ); + return current_user_can( 'edit_qsm_quizzes' ); }, ) ); @@ -90,7 +90,7 @@ function qsm_register_rest_routes() { 'methods' => WP_REST_Server::EDITABLE, 'callback' => 'qsm_rest_save_emails', 'permission_callback' => function () { - return current_user_can( 'edit_posts' ); + return current_user_can( 'edit_qsm_quizzes' ); }, ) ); @@ -123,7 +123,7 @@ function qsm_register_rest_routes() { 'methods' => WP_REST_Server::READABLE, 'callback' => 'qsm_rest_get_bank_questions', 'permission_callback' => function () { - return current_user_can( 'edit_posts' ); + return current_user_can( 'edit_qsm_quizzes' ); }, ) );