Code Duplication    Length = 7-7 lines in 2 locations

_inc/lib/class.core-rest-api-endpoints.php 2 locations

@@ 991-997 (lines=7) @@
988
	 *
989
	 * @return bool Whether user has the capability 'jetpack_configure_modules'.
990
	 */
991
	public static function configure_modules_permission_check() {
992
		if ( current_user_can( 'jetpack_configure_modules' ) ) {
993
			return true;
994
		}
995
996
		return new WP_Error( 'invalid_user_permission_configure_modules', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) );
997
	}
998
999
	/**
1000
	 * Verify that user can view Jetpack admin page.
@@ 1036-1042 (lines=7) @@
1033
	 *
1034
	 * @return bool Whether user has the capability 'update_settings_permission_check'.
1035
	 */
1036
	public static function update_settings_permission_check() {
1037
		if ( current_user_can( 'jetpack_configure_modules' ) ) {
1038
			return true;
1039
		}
1040
1041
		return new WP_Error( 'invalid_user_permission_manage_settings', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) );
1042
	}
1043
1044
	/**
1045
	 * Verify that user can view Jetpack admin page and can activate plugins.