Răsfoiți Sursa

gc-1100-config-getter-add

TsuyoshiSuzukief 7 ani în urmă
părinte
comite
d187ae5174

+ 1 - 0
src/client/js/components/SavePageControls.jsx

@@ -41,6 +41,7 @@ class SavePageControls extends React.PureComponent {
 
 
   render() {
   render() {
     const { t } = this.props;
     const { t } = this.props;
+
     const config = this.props.crowi.getConfig();
     const config = this.props.crowi.getConfig();
     const aclEnable = config.isEnabledAcl;
     const aclEnable = config.isEnabledAcl;
     const label = this.state.pageId == null ? t('Create') : t('Update');
     const label = this.state.pageId == null ? t('Create') : t('Update');

+ 5 - 0
src/server/models/config.js

@@ -329,6 +329,11 @@ module.exports = function(crowi) {
   };
   };
 
 
   configSchema.statics.isGuesstAllowedToRead = function(config) {
   configSchema.statics.isGuesstAllowedToRead = function(config) {
+    // return true if puclic wiki mode
+    if (process.env.ACL_ENABLE === 'false') {
+      return true;
+    }
+
     // return false if undefined
     // return false if undefined
     if (undefined === config.crowi || undefined === config.crowi['security:restrictGuestMode']) {
     if (undefined === config.crowi || undefined === config.crowi['security:restrictGuestMode']) {
       return false;
       return false;