Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Commit 2e2d526

Browse files
committed
ページ作成者かadmin以外は編集範囲を変更できないようにした
1 parent 4b5eaf9 commit 2e2d526

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/models/page.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ module.exports = function(crowi) {
422422
pageSchema.statics.getEditLabels = function() {
423423
var editLabels = {};
424424
editLabels[EDIT_PUBLIC] = '全員が編集可能';
425-
editLabels[EDIT_OWNER] = '自分のみ編集可能';
425+
editLabels[EDIT_OWNER] = 'ページ作成者のみ編集可能';
426426

427427
return editLabels;
428428
};

lib/views/_form.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
<input type="hidden" name="pageForm[grant]" value="{{ forceGrant }}">
4545
{% else %}
4646

47-
{% if (page.isCreator(user) or user.admin) and not pageUser %}
47+
{% if (page.isCreator(user) or user.admin or page.isEdit()) and not pageUser %}
4848
<select name="pageForm[canEdit]" class="form-control">
4949
{% for editId, editLabel in consts.editGrants %}
50-
<option value="{{ editId }}" {% if pageForm.canEdit|default(page.canEdit) == editId %}selected{% endif %}>{{ editLabel }}</option>
50+
<option value="{{ editId }}" {% if pageForm.canEdit|default(page.canEdit) == editId %}selected{% endif %} {% if not (user.admin or page.isCreator(user)) and not (pageForm.canEdit|default(page.canEdit) == editId) %}disabled{% endif %}>{{ editLabel }}</option>
5151
{% endfor %}
5252
</select>
5353
{% endif %}

0 commit comments

Comments
 (0)