Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 793-800 (lines=8) @@
790
	 *
791
	 * @return bool|WP_Error True if user is able to disconnect the site.
792
	 */
793
	public static function connect_url_permission_callback() {
794
		if ( current_user_can( 'jetpack_connect_user' ) ) {
795
			return true;
796
		}
797
798
		return new WP_Error( 'invalid_user_permission_jetpack_connect', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
799
800
	}
801
802
	/**
803
	 * Verify that a user can get the data about the current user.
@@ 812-818 (lines=7) @@
809
	 *
810
	 * @return bool|WP_Error True if user is able to unlink.
811
	 */
812
	public static function get_user_connection_data_permission_callback() {
813
		if ( current_user_can( 'jetpack_connect_user' ) ) {
814
			return true;
815
		}
816
817
		return new WP_Error( 'invalid_user_permission_user_connection_data', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
818
	}
819
820
	/**
821
	 * Check that user has permission to change the master user.