settings: Add can_delete_any_message_group setting.

Fixes #30717.
This commit is contained in:
Vector73
2024-08-15 10:59:15 +05:30
committed by Tim Abbott
parent dc938768ca
commit 80969a62e6
26 changed files with 446 additions and 53 deletions

View File

@@ -781,6 +781,7 @@ class UserProfile(AbstractBaseUser, PermissionsMixin, UserBaseSettings):
"can_create_private_channel_group",
"can_create_public_channel_group",
"can_create_web_public_channel_group",
"can_delete_any_message_group",
"create_multiuse_invite_group",
"delete_own_message_policy",
"direct_message_initiator_group",
@@ -868,6 +869,9 @@ class UserProfile(AbstractBaseUser, PermissionsMixin, UserBaseSettings):
def can_add_custom_emoji(self) -> bool:
return self.has_permission("add_custom_emoji_policy")
def can_delete_any_message(self) -> bool:
return self.has_permission("can_delete_any_message_group")
def can_delete_own_message(self) -> bool:
return self.has_permission("delete_own_message_policy")