Răsfoiți Sursa

Merge pull request #1078 from weseek/fix/change-security-value

chage name to anyOne
Yuki Takei 6 ani în urmă
părinte
comite
fdb5fa3397
2 a modificat fișierele cu 5 adăugiri și 2 ștergeri
  1. 4 1
      src/server/models/user.js
  2. 1 1
      src/server/views/admin/security.html

+ 4 - 1
src/server/models/user.js

@@ -200,7 +200,10 @@ module.exports = function(crowi) {
 
   userSchema.methods.canDeleteCompletely = function(creatorId) {
     const pageCompleteDeletionAuthority = crowi.configManager.getConfig('crowi', 'security:pageCompleteDeletionAuthority');
-    if (pageCompleteDeletionAuthority == null || this.admin) {
+    if (this.admin) {
+      return true;
+    }
+    if (pageCompleteDeletionAuthority === 'anyOne' || pageCompleteDeletionAuthority == null) {
       return true;
     }
     if (pageCompleteDeletionAuthority === 'adminAndAuthor') {

+ 1 - 1
src/server/views/admin/security.html

@@ -120,7 +120,7 @@
             <label for="{{configName}}" class="col-xs-3 control-label">{{ t('security_setting.complete_deletion') }}</label>
             <div class="col-xs-6">
               <select class="form-control selectpicker" name="settingForm[security:pageCompleteDeletionAuthority]" value="{{ configValue }}">
-                <option value=null {% if configValue == null  %}selected{% endif %}>{{ t('security_setting.anyone') }}</option>
+                <option value="anyOne" {% if configValue == "anyOne" %}selected{% endif %}>{{ t('security_setting.anyone') }}</option>
                 <option value="adminOnly" {% if configValue =="adiminOnly" %}selected{% endif %}>{{ t('security_setting.admin_only') }}</option>
                 <option value="adminAndAuthor" {% if configValue == "adminAndAuthor" %}selected{% endif %}>{{ t('security_setting.admin_and_author') }}</option>
               </select>