Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 909-916 (lines=8) @@
906
	 *
907
	 * @return bool|WP_Error True if user is able to disconnect the site.
908
	 */
909
	public static function connect_url_permission_callback() {
910
		if ( current_user_can( 'jetpack_connect_user' ) ) {
911
			return true;
912
		}
913
914
		return new WP_Error( 'invalid_user_permission_jetpack_connect', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) );
915
916
	}
917
918
	/**
919
	 * Verify that a user can get the data about the current user.
@@ 928-934 (lines=7) @@
925
	 *
926
	 * @return bool|WP_Error True if user is able to unlink.
927
	 */
928
	public static function get_user_connection_data_permission_callback() {
929
		if ( current_user_can( 'jetpack_connect_user' ) ) {
930
			return true;
931
		}
932
933
		return new WP_Error( 'invalid_user_permission_user_connection_data', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) );
934
	}
935
936
	/**
937
	 * Check that user has permission to change the master user.