Allow users to edit existing documents, even if they belong in categories they don't have permission to write in anymore

This commit is contained in:
Kijin Sung 2025-10-24 17:51:33 +09:00
parent b119578209
commit e676949669
5 changed files with 77 additions and 82 deletions

View file

@ -756,7 +756,7 @@ class DocumentController extends Document
{
if (!$category_list[$obj->category_srl]->grant)
{
return new BaseObject(-1, 'msg_not_permitted');
return new BaseObject(-1, 'document.msg_category_not_permitted');
}
}
else
@ -764,6 +764,10 @@ class DocumentController extends Document
$obj->category_srl = 0;
}
}
else
{
$obj->category_srl = 0;
}
}
// Set the read counts and update order.
@ -1116,7 +1120,7 @@ class DocumentController extends Document
{
if (!$category_list[$obj->category_srl]->grant)
{
return new BaseObject(-1, 'msg_not_permitted');
return new BaseObject(-1, 'document.msg_category_not_permitted');
}
}
else
@ -1124,6 +1128,10 @@ class DocumentController extends Document
$obj->category_srl = 0;
}
}
else
{
$obj->category_srl = 0;
}
}
// Hash the password if it exists

View file

@ -38,6 +38,7 @@ $lang->msg_category_not_moved = 'Could not be moved';
$lang->msg_is_secret = 'This is a secret article.';
$lang->msg_checked_document_is_deleted = '%d article(s) was(were) deleted.';
$lang->msg_document_is_admin_not_permitted = 'You don\'t have permission to delete the posts of Top Admin.';
$lang->msg_category_not_permitted = 'You don\'t have permission to post in the selected category.';
$lang->move_target_module = 'Target module ';
$lang->search_target_list['title'] = 'Subject';
$lang->search_target_list['content'] = 'Content';

View file

@ -38,6 +38,7 @@ $lang->msg_category_not_moved = '이동할 수 없습니다.';
$lang->msg_is_secret = '비밀글입니다.';
$lang->msg_checked_document_is_deleted = '%d개의 글이 삭제되었습니다.';
$lang->msg_document_is_admin_not_permitted = '최고 관리자의 게시글을 삭제할 권한이 없습니다.';
$lang->msg_category_not_permitted = '선택한 분류에 게시할 권한이 없습니다.';
$lang->move_target_module = '대상 페이지';
$lang->search_target_list['title'] = '제목';
$lang->search_target_list['content'] = '내용';