@@ -214,7 +214,10 @@ public String showInfo(
214
214
}
215
215
216
216
String lang = LocaleUtils .getLanguageOrNull (userLocale );
217
- SeriesDto series = seriesService .findFullInfoById (seriesId , lang );
217
+ boolean userCanSeeHiddenImages = SecurityContextUtils .hasAuthority (
218
+ Authority .VIEW_HIDDEN_IMAGES
219
+ );
220
+ SeriesDto series = seriesService .findFullInfoById (seriesId , lang , userCanSeeHiddenImages );
218
221
if (series == null ) {
219
222
response .sendError (HttpServletResponse .SC_NOT_FOUND );
220
223
return null ;
@@ -363,7 +366,10 @@ public String processImage(
363
366
}
364
367
365
368
String lang = LocaleUtils .getLanguageOrNull (userLocale );
366
- SeriesDto series = seriesService .findFullInfoById (seriesId , lang );
369
+ boolean userCanSeeHiddenImages = SecurityContextUtils .hasAuthority (
370
+ Authority .VIEW_HIDDEN_IMAGES
371
+ );
372
+ SeriesDto series = seriesService .findFullInfoById (seriesId , lang , userCanSeeHiddenImages );
367
373
if (series == null ) {
368
374
response .sendError (HttpServletResponse .SC_NOT_FOUND );
369
375
return null ;
@@ -434,7 +440,14 @@ public String addToCollection(
434
440
435
441
if (result .hasErrors ()) {
436
442
String lang = LocaleUtils .getLanguageOrNull (userLocale );
437
- SeriesDto series = seriesService .findFullInfoById (seriesId , lang );
443
+ boolean userCanSeeHiddenImages = SecurityContextUtils .hasAuthority (
444
+ Authority .VIEW_HIDDEN_IMAGES
445
+ );
446
+ SeriesDto series = seriesService .findFullInfoById (
447
+ seriesId ,
448
+ lang ,
449
+ userCanSeeHiddenImages
450
+ );
438
451
if (series == null ) {
439
452
response .sendError (HttpServletResponse .SC_NOT_FOUND );
440
453
return null ;
@@ -511,7 +524,10 @@ public String processAskForm(
511
524
}
512
525
513
526
String lang = LocaleUtils .getLanguageOrNull (userLocale );
514
- SeriesDto series = seriesService .findFullInfoById (seriesId , lang );
527
+ boolean userCanSeeHiddenImages = SecurityContextUtils .hasAuthority (
528
+ Authority .VIEW_HIDDEN_IMAGES
529
+ );
530
+ SeriesDto series = seriesService .findFullInfoById (seriesId , lang , userCanSeeHiddenImages );
515
531
if (series == null ) {
516
532
response .sendError (HttpServletResponse .SC_NOT_FOUND );
517
533
return null ;
0 commit comments