Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 690-697 (lines=8) @@
687
	 *
688
	 * @return bool|WP_Error True if user is able to disconnect the site.
689
	 */
690
	public static function connect_url_permission_callback() {
691
		if ( current_user_can( 'jetpack_connect_user' ) ) {
692
			return true;
693
		}
694
695
		return new WP_Error( 'invalid_user_permission_jetpack_disconnect', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
696
697
	}
698
699
	/**
700
	 * Verify that a user can get the data about the current user.
@@ 709-715 (lines=7) @@
706
	 *
707
	 * @return bool|WP_Error True if user is able to unlink.
708
	 */
709
	public static function get_user_connection_data_permission_callback() {
710
		if ( current_user_can( 'jetpack_connect_user' ) ) {
711
			return true;
712
		}
713
714
		return new WP_Error( 'invalid_user_permission_user_connection_data', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
715
	}
716
717
	/**
718
	 * Check that user has permission to change the master user.