getUser($request), $file)) { throw new AuthorizationFailedException(); } return $this->getContentResponse( $file->refs->filter( function ($ref) use ($user) { return Authority::canShowFileRef($user, $ref); } ) ); } }