itizawa 6 лет назад
Родитель
Сommit
77d28e6307

+ 1 - 1
src/server/form/admin/securityGeneral.js

@@ -12,5 +12,5 @@ module.exports = form(
   field('settingForm[security:registrationWhiteList]').custom(normalizeCRLF).custom(stringToArray),
   field('settingForm[security:list-policy:hideRestrictedByOwner]').trim().toBooleanStrict(),
   field('settingForm[security:list-policy:hideRestrictedByGroup]').trim().toBooleanStrict(),
-  field('settingForm[security:isEnabledDeleteCompletely]').trim().toBooleanStrict(),
+  field('settingForm[security:AuthorityofCompletelyDeletion]'),
 );

+ 1 - 1
src/server/models/config.js

@@ -64,7 +64,7 @@ module.exports = function(crowi) {
 
       'security:list-policy:hideRestrictedByOwner' : false,
       'security:list-policy:hideRestrictedByGroup' : false,
-      'security:isEnabledDeleteCompletely' : false,
+      'security:AuthorityofCompletelyDeletion' : 'adminOnly',
 
       'security:isEnabledPassport' : false,
       'security:passport-ldap:isEnabled' : false,

+ 8 - 11
src/server/views/admin/security.html

@@ -138,18 +138,15 @@
 
           <!-- GC-1755 Change Sentence -->
           <div class="form-group">
-            {% set configName = 'settingForm[security:isEnabledDeleteCompletely]' %}
-            {% set configValue = getConfig('crowi','security:isEnabledDeleteCompletely') %}
+            {% set configName = 'settingForm[security:AuthorityofCompletelyDeletion]' %}
+            {% set configValue = getConfig('crowi','security:AuthorityofCompletelyDeletion') %}
             <label for="{{configName}}" class="col-xs-3 control-label">Restrict Complete Deletion of Pages</label>
-            <div class="col-xs-9">
-              <div class="btn-group btn-toggle" data-toggle="buttons">
-                <label class="btn btn-default btn-rounded btn-outline {% if configValue %}active{% endif %}" data-active-class="primary">
-                  <input name="{{configName}}" value="true" type="radio" {% if configValue %}checked{% endif %}> ON
-                </label>
-                <label class="btn btn-default btn-rounded btn-outline {% if !configValue %}active{% endif %}" data-active-class="default">
-                  <input name="{{configName}}" value="false" type="radio" {% if !configValue %}checked{% endif %}> OFF
-                </label>
-              </div>
+            <div class="col-xs-6">
+              <select class="form-control selectpicker" name="settingForm[security:AuthorityofCompletelyDeletion]" value="{{ configValue }}">
+                <option value="adminOnly" {% if configValue =="adiminOnly" %}selected{% endif %}>AdminOnly</option>
+                <option value="adminAndAuthor" {% if configValue == "adminAndAuthor" %}selected{% endif %}>AdminAndAuthor</option>
+                <option value="anyone" {% if configValue == "anyone"  %}selected{% endif %}>Anyone</option>
+              </select>
 
               <p class="help-block small">
                 Restricts users who can completely delete pages to only administrators.