Allow access to all galleys except PDF for non-logged users

How in OJS 3.1.0-1 code allow access for all users (including not logged) to all non-PDF galleys with turn on “The journal will require subscriptions to access some or all of its contents.” mode? That is, that all users have access to any galleys except PDF, and that the authors had in addition access to the PDF of their articles, and the editors had access to any types of the galleys. Now, unauthorized users can not download any PDF files AND other kind of galleys.
Since this type of system behavior is needed for all articles in the journal, I do not need the option in the article or issue properties. I want to implement this behavior for all articles in our journal.

If I correctly understood, it will require somehow to change function userCanViewGalley($request, $articleId, $galleyId = null) in, but how?