getUser($request), $resource)) { throw new AuthorizationFailedException(); } return $response->withBody( $stream = Psr7\stream_for($resource->type->readCustomFile($args['id'])) ); } }