1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-11-06 08:59:28 +02:00

Disable directory flattening if sharing is not available. fixes #601

This commit is contained in:
Patrik J. Braun
2023-02-21 10:20:31 +01:00
parent edb974cf0b
commit a35c4e5bda
7 changed files with 7 additions and 11 deletions

View File

@@ -93,7 +93,7 @@ export class AuthenticationService {
}
public canSearch(): boolean {
return this.isAuthorized(UserRoles.Guest);
return Config.Search.enabled && this.isAuthorized(UserRoles.Guest);
}
public async logout(): Promise<void> {

View File

@@ -120,8 +120,7 @@ export class GalleryComponent implements OnInit, OnDestroy {
) {
return this.navigation.toLogin();
}
this.showSearchBar =
Config.Search.enabled && this.authService.canSearch();
this.showSearchBar = this.authService.canSearch();
this.showShare =
Config.Sharing.enabled &&
this.authService.isAuthorized(UserRoles.User);

View File

@@ -51,8 +51,7 @@ export class GalleryPhotoComponent implements IRenderable, OnInit, OnDestroy {
private thumbnailService: ThumbnailManagerService,
private authService: AuthenticationService
) {
this.searchEnabled =
Config.Search.enabled && this.authService.canSearch();
this.searchEnabled = this.authService.canSearch();
}
get ScrollListener(): boolean {

View File

@@ -66,8 +66,7 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
private authService: AuthenticationService,
private cacheService: GalleryCacheService
) {
this.searchEnabled =
Config.Search.enabled && this.authService.canSearch();
this.searchEnabled = this.authService.canSearch();
}

View File

@@ -35,8 +35,7 @@ export class InfoPanelLightboxComponent implements OnInit, OnChanges {
private authService: AuthenticationService
) {
this.mapEnabled = Config.Map.enabled;
this.searchEnabled =
Config.Search.enabled && this.authService.canSearch();
this.searchEnabled = this.authService.canSearch();
this.baseLayer = tileLayer(mapService.MapLayer, {
attribution: mapService.ShortAttributions,
});

View File

@@ -34,7 +34,7 @@
<div class="divider">&nbsp;</div>
</ng-container>
<ng-container *ngIf="config.Gallery.enableDirectoryFlattening && isDirectory">
<ng-container *ngIf="config.Gallery.enableDirectoryFlattening && isDirectory && authService.canSearch()">
<a
[routerLink]="['/search', getDirectoryFlattenSearchQuery()]"
class="btn btn-navbar">

View File

@@ -39,7 +39,7 @@ export class GalleryNavigatorComponent {
private readonly RootFolderName: string;
constructor(
private authService: AuthenticationService,
public authService: AuthenticationService,
public queryService: QueryService,
public galleryService: ContentService,
public sortingService: GallerySortingService