Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 920-927 (lines=8) @@
917
	 *
918
	 * @return bool|WP_Error True if user is able to disconnect the site.
919
	 */
920
	public static function connect_url_permission_callback() {
921
		if ( current_user_can( 'jetpack_connect_user' ) ) {
922
			return true;
923
		}
924
925
		return new WP_Error( 'invalid_user_permission_jetpack_connect', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
926
927
	}
928
929
	/**
930
	 * Verify that a user can get the data about the current user.
@@ 939-945 (lines=7) @@
936
	 *
937
	 * @return bool|WP_Error True if user is able to unlink.
938
	 */
939
	public static function get_user_connection_data_permission_callback() {
940
		if ( current_user_can( 'jetpack_connect_user' ) ) {
941
			return true;
942
		}
943
944
		return new WP_Error( 'invalid_user_permission_user_connection_data', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
945
	}
946
947
	/**
948
	 * Check that user has permission to change the master user.