diff --git a/src/app/main/main.component.ts b/src/app/main/main.component.ts
index 107c311..97c9ab2 100644
--- a/src/app/main/main.component.ts
+++ b/src/app/main/main.component.ts
@@ -230,7 +230,7 @@ export class MainComponent implements OnInit {
async loadConfig() {
// loading config
this.fileManagerEnabled = this.postsService.config['Extra']['file_manager_enabled']
- && (!this.postsService.isLoggedIn || this.postsService.permissions.includes('filemanager'));
+ && this.postsService.hasPermission('filemanager');
this.downloadOnlyMode = this.postsService.config['Extra']['download_only_mode'];
this.allowMultiDownloadMode = this.postsService.config['Extra']['allow_multi_download_mode'];
this.audioFolderPath = this.postsService.config['Downloader']['path-audio'];
@@ -242,7 +242,7 @@ export class MainComponent implements OnInit {
this.youtubeAPIKey = this.youtubeSearchEnabled ? this.postsService.config['API']['youtube_API_key'] : null;
this.allowQualitySelect = this.postsService.config['Extra']['allow_quality_select'];
this.allowAdvancedDownload = this.postsService.config['Advanced']['allow_advanced_download']
- && (!this.postsService.isLoggedIn || this.postsService.permissions.includes('advanced_download'));
+ && this.postsService.hasPermission('advanced_download');
this.useDefaultDownloadingAgent = this.postsService.config['Advanced']['use_default_downloading_agent'];
this.customDownloadingAgent = this.postsService.config['Advanced']['custom_downloading_agent'];
diff --git a/src/app/posts.services.ts b/src/app/posts.services.ts
index 11ff640..514dc45 100644
--- a/src/app/posts.services.ts
+++ b/src/app/posts.services.ts
@@ -498,6 +498,12 @@ export class PostsService implements CanActivate {
this.resetHttpParams();
}
+ hasPermission(permission) {
+ // assume not logged in users never have permission
+ if (this.config.Advanced.multi_user_mode && !this.isLoggedIn) return false;
+ return this.config.Advanced.multi_user_mode ? this.permissions.includes(permission) : true;
+ }
+
// user methods
register(username, password) {
const call = this.http.post(this.path + 'auth/register', {userid: username,
diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html
index e16de14..272e61f 100644
--- a/src/app/settings/settings.component.html
+++ b/src/app/settings/settings.component.html
@@ -1,13 +1,12 @@
-
Settings
+
Settings
-
-
+
@@ -391,7 +390,7 @@