message_edit: Remove get_editability function.

This commit removes get_editability function and we can instead
use is_content_editable and is_topic_editable/can_move_message
functions to check the permissions. We can remove get_editability
since there is no longer a sort order to the possibilities and
it is not necessary that if a user has permission to edit content
then they can edit the topics also.

So, this commit adds is_message_editable_ignoring_permissions
check to is_content_editable and also modifies the tests accordingly.
This commit is contained in:
Sahil Batra
2022-12-12 20:07:14 +05:30
committed by Tim Abbott
parent 98c4e11d0b
commit d0626bbaef
4 changed files with 28 additions and 101 deletions

View File

@@ -142,10 +142,7 @@ function message_hover($message_row) {
}
// But the message edit hover icon is determined by whether the message is still editable
const editability = message_edit.get_editability(message);
const is_content_editable =
editability === message_edit.editability_types.FULL ||
editability === message_edit.editability_types.CONTENT_ONLY;
const is_content_editable = message_edit.is_content_editable(message);
const can_move_message = message_edit.can_move_message(message);
const args = {