Yuki Takei 6 лет назад
Родитель
Сommit
fbc07591fb
1 измененных файлов с 15 добавлено и 6 удалено
  1. 15 6
      src/server/service/acl.js

+ 15 - 6
src/server/service/acl.js

@@ -16,11 +16,17 @@ class AclService {
     };
     };
   }
   }
 
 
+  /**
+   * @returns Whether Access Control is enabled or not
+   */
   isAclEnabled() {
   isAclEnabled() {
     const wikiMode = this.configManager.getConfig('crowi', 'security:wikiMode');
     const wikiMode = this.configManager.getConfig('crowi', 'security:wikiMode');
     return wikiMode !== 'public';
     return wikiMode !== 'public';
   }
   }
 
 
+  /**
+   * @returns Whether wiki mode is set
+   */
   isWikiModeForced() {
   isWikiModeForced() {
     const wikiMode = this.configManager.getConfig('crowi', 'security:wikiMode');
     const wikiMode = this.configManager.getConfig('crowi', 'security:wikiMode');
     const isPrivateOrPublic = wikiMode === 'private' || wikiMode === 'public';
     const isPrivateOrPublic = wikiMode === 'private' || wikiMode === 'public';
@@ -28,12 +34,9 @@ class AclService {
     return isPrivateOrPublic;
     return isPrivateOrPublic;
   }
   }
 
 
-  getGuestModeValue() {
-    return this.isGuestAllowedToRead()
-      ? this.labels.SECURITY_RESTRICT_GUEST_MODE_READONLY
-      : this.labels.SECURITY_RESTRICT_GUEST_MODE_DENY;
-  }
-
+  /**
+   * @returns Whether guest users are allowed to read public pages
+   */
   isGuestAllowedToRead() {
   isGuestAllowedToRead() {
     const wikiMode = this.configManager.getConfig('crowi', 'security:wikiMode');
     const wikiMode = this.configManager.getConfig('crowi', 'security:wikiMode');
 
 
@@ -53,6 +56,12 @@ class AclService {
     return guestMode === this.labels.SECURITY_RESTRICT_GUEST_MODE_READONLY;
     return guestMode === this.labels.SECURITY_RESTRICT_GUEST_MODE_READONLY;
   }
   }
 
 
+  getGuestModeValue() {
+    return this.isGuestAllowedToRead()
+      ? this.labels.SECURITY_RESTRICT_GUEST_MODE_READONLY
+      : this.labels.SECURITY_RESTRICT_GUEST_MODE_DENY;
+  }
+
   getRestrictGuestModeLabels() {
   getRestrictGuestModeLabels() {
     const labels = {};
     const labels = {};
     labels[this.labels.SECURITY_RESTRICT_GUEST_MODE_DENY] = 'security_setting.guest_mode.deny';
     labels[this.labels.SECURITY_RESTRICT_GUEST_MODE_DENY] = 'security_setting.guest_mode.deny';