Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 744-751 (lines=8) @@
741
	 *
742
	 * @return bool|WP_Error True if user is able to disconnect the site.
743
	 */
744
	public static function connect_url_permission_callback() {
745
		if ( current_user_can( 'jetpack_connect_user' ) ) {
746
			return true;
747
		}
748
749
		return new WP_Error( 'invalid_user_permission_jetpack_disconnect', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
750
751
	}
752
753
	/**
754
	 * Verify that a user can get the data about the current user.
@@ 763-769 (lines=7) @@
760
	 *
761
	 * @return bool|WP_Error True if user is able to unlink.
762
	 */
763
	public static function get_user_connection_data_permission_callback() {
764
		if ( current_user_can( 'jetpack_connect_user' ) ) {
765
			return true;
766
		}
767
768
		return new WP_Error( 'invalid_user_permission_user_connection_data', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
769
	}
770
771
	/**
772
	 * Check that user has permission to change the master user.