mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	settings: Remove move_messages_between_streams_policy setting.
				
					
				
			Removed `move_messages_between_streams_policy` property, as the permission to move messages between channels is now controlled by `can_move_messages_between_channels_group` setting.
This commit is contained in:
		@@ -27,6 +27,10 @@ format used by the Zulip server that they are interacting with.
 | 
			
		||||
  Added `can_move_messages_between_channels_group` realm setting which is a
 | 
			
		||||
  [group-setting value](/api/group-setting-values) describing the set of users
 | 
			
		||||
  with permission to move messages from one channel to another in the organization.
 | 
			
		||||
* `PATCH /realm`, [`GET /events`](/api/get-events): Removed
 | 
			
		||||
  `move_messages_between_streams_policy` property, as the permission to move
 | 
			
		||||
  messages between channels in the organization is now controlled by
 | 
			
		||||
  `can_move_messages_between_channels_group` setting.
 | 
			
		||||
 | 
			
		||||
**Feature level 309**
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,16 @@
 | 
			
		||||
# Generated by Django 5.0.9 on 2024-10-15 09:51
 | 
			
		||||
 | 
			
		||||
from django.db import migrations
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Migration(migrations.Migration):
 | 
			
		||||
    dependencies = [
 | 
			
		||||
        ("zerver", "0613_alter_realm_can_move_messages_between_channels_group"),
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    operations = [
 | 
			
		||||
        migrations.RemoveField(
 | 
			
		||||
            model_name="realm",
 | 
			
		||||
            name="move_messages_between_streams_policy",
 | 
			
		||||
        ),
 | 
			
		||||
    ]
 | 
			
		||||
@@ -270,8 +270,6 @@ class Realm(models.Model):  # type: ignore[django-manager-missing] # django-stub
 | 
			
		||||
 | 
			
		||||
    EDIT_TOPIC_POLICY_TYPES = [field.value for field in EditTopicPolicyEnum]
 | 
			
		||||
 | 
			
		||||
    MOVE_MESSAGES_BETWEEN_STREAMS_POLICY_TYPES = INVITE_TO_REALM_POLICY_TYPES
 | 
			
		||||
 | 
			
		||||
    DEFAULT_MOVE_MESSAGE_LIMIT_SECONDS = 7 * SECONDS_PER_DAY
 | 
			
		||||
 | 
			
		||||
    move_messages_within_stream_limit_seconds = models.PositiveIntegerField(
 | 
			
		||||
@@ -354,11 +352,6 @@ class Realm(models.Model):  # type: ignore[django-manager-missing] # django-stub
 | 
			
		||||
        default=CommonPolicyEnum.MEMBERS_ONLY
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    # Who in the organization is allowed to move messages between streams.
 | 
			
		||||
    move_messages_between_streams_policy = models.PositiveSmallIntegerField(
 | 
			
		||||
        default=POLICY_MEMBERS_ONLY
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    # UserGroup which is allowed to move messages between streams.
 | 
			
		||||
    can_move_messages_between_channels_group = models.ForeignKey(
 | 
			
		||||
        "UserGroup", on_delete=models.RESTRICT, related_name="+"
 | 
			
		||||
@@ -676,7 +669,6 @@ class Realm(models.Model):  # type: ignore[django-manager-missing] # django-stub
 | 
			
		||||
        move_messages_between_streams_limit_seconds=(int, type(None)),
 | 
			
		||||
        move_messages_within_stream_limit_seconds=(int, type(None)),
 | 
			
		||||
        message_retention_days=(int, type(None)),
 | 
			
		||||
        move_messages_between_streams_policy=int,
 | 
			
		||||
        name=str,
 | 
			
		||||
        name_changes_disabled=bool,
 | 
			
		||||
        push_notifications_enabled=bool,
 | 
			
		||||
 
 | 
			
		||||
@@ -830,7 +830,6 @@ class UserProfile(AbstractBaseUser, PermissionsMixin, UserBaseSettings):
 | 
			
		||||
            "edit_topic_policy",
 | 
			
		||||
            "invite_to_stream_policy",
 | 
			
		||||
            "invite_to_realm_policy",
 | 
			
		||||
            "move_messages_between_streams_policy",
 | 
			
		||||
        ]:
 | 
			
		||||
            raise AssertionError("Invalid policy")
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4795,27 +4795,6 @@ paths:
 | 
			
		||||
                                        **Changes**: New in Zulip 7.0 (feature level 162). Previously, there was
 | 
			
		||||
                                        no time limit for moving messages between channels for users with permission
 | 
			
		||||
                                        to do so.
 | 
			
		||||
                                    move_messages_between_streams_policy:
 | 
			
		||||
                                      type: integer
 | 
			
		||||
                                      description: |
 | 
			
		||||
                                        The [policy][permission-level] for which users can move messages from
 | 
			
		||||
                                        one channel to another.
 | 
			
		||||
 | 
			
		||||
                                        - 1 = Members only
 | 
			
		||||
                                        - 2 = Administrators only
 | 
			
		||||
                                        - 3 = [Full members][calc-full-member] only
 | 
			
		||||
                                        - 4 = Moderators only
 | 
			
		||||
                                        - 6 = Nobody
 | 
			
		||||
 | 
			
		||||
                                        See [`PATCH /messages/{message_id}`](/api/update-message) for details and
 | 
			
		||||
                                        history of how message editing permissions work.
 | 
			
		||||
 | 
			
		||||
                                        **Changes**: Nobody added as an option in Zulip 7.0 (feature level 159).
 | 
			
		||||
 | 
			
		||||
                                        New in Zulip 4.0 (feature level 56).
 | 
			
		||||
 | 
			
		||||
                                        [permission-level]: /api/roles-and-permissions#permission-levels
 | 
			
		||||
                                        [calc-full-member]: /api/roles-and-permissions#determining-if-a-user-is-a-full-member
 | 
			
		||||
                                    name:
 | 
			
		||||
                                      type: string
 | 
			
		||||
                                      description: |
 | 
			
		||||
@@ -16879,29 +16858,6 @@ paths:
 | 
			
		||||
 | 
			
		||||
                          New in Zulip 5.0 (feature level 75).
 | 
			
		||||
 | 
			
		||||
                          [permission-level]: /api/roles-and-permissions#permission-levels
 | 
			
		||||
                          [calc-full-member]: /api/roles-and-permissions#determining-if-a-user-is-a-full-member
 | 
			
		||||
                      realm_move_messages_between_streams_policy:
 | 
			
		||||
                        type: integer
 | 
			
		||||
                        description: |
 | 
			
		||||
                          Present if `realm` is present in `fetch_event_types`.
 | 
			
		||||
 | 
			
		||||
                          The [policy][permission-level] for which users can move messages
 | 
			
		||||
                          from one channel to another.
 | 
			
		||||
 | 
			
		||||
                          - 1 = Members only
 | 
			
		||||
                          - 2 = Administrators only
 | 
			
		||||
                          - 3 = [Full members][calc-full-member] only
 | 
			
		||||
                          - 4 = Moderators only
 | 
			
		||||
                          - 6 = Nobody
 | 
			
		||||
 | 
			
		||||
                          See [`PATCH /messages/{message_id}`](/api/update-message) for details
 | 
			
		||||
                          and history of how message editing permissions work.
 | 
			
		||||
 | 
			
		||||
                          **Changes**: Nobody added as an option in Zulip 7.0 (feature level 159).
 | 
			
		||||
 | 
			
		||||
                          New in Zulip 4.0 (feature level 56).
 | 
			
		||||
 | 
			
		||||
                          [permission-level]: /api/roles-and-permissions#permission-levels
 | 
			
		||||
                          [calc-full-member]: /api/roles-and-permissions#determining-if-a-user-is-a-full-member
 | 
			
		||||
                      realm_message_content_edit_limit_seconds:
 | 
			
		||||
 
 | 
			
		||||
@@ -3714,7 +3714,6 @@ class RealmPropertyActionTest(BaseAction):
 | 
			
		||||
            default_code_block_language=["python", "javascript"],
 | 
			
		||||
            message_content_delete_limit_seconds=[1000, 1100, 1200],
 | 
			
		||||
            invite_to_realm_policy=Realm.INVITE_TO_REALM_POLICY_TYPES,
 | 
			
		||||
            move_messages_between_streams_policy=Realm.MOVE_MESSAGES_BETWEEN_STREAMS_POLICY_TYPES,
 | 
			
		||||
            edit_topic_policy=Realm.EDIT_TOPIC_POLICY_TYPES,
 | 
			
		||||
            message_content_edit_limit_seconds=[1000, 1100, 1200, None],
 | 
			
		||||
            move_messages_within_stream_limit_seconds=[1000, 1100, 1200],
 | 
			
		||||
 
 | 
			
		||||
@@ -185,7 +185,6 @@ class HomeTest(ZulipTestCase):
 | 
			
		||||
        "realm_message_content_edit_limit_seconds",
 | 
			
		||||
        "realm_message_retention_days",
 | 
			
		||||
        "realm_move_messages_between_streams_limit_seconds",
 | 
			
		||||
        "realm_move_messages_between_streams_policy",
 | 
			
		||||
        "realm_move_messages_within_stream_limit_seconds",
 | 
			
		||||
        "realm_name",
 | 
			
		||||
        "realm_name_changes_disabled",
 | 
			
		||||
 
 | 
			
		||||
@@ -850,7 +850,6 @@ class RealmTest(ZulipTestCase):
 | 
			
		||||
            message_content_delete_limit_seconds=-10,
 | 
			
		||||
            wildcard_mention_policy=10,
 | 
			
		||||
            invite_to_realm_policy=10,
 | 
			
		||||
            move_messages_between_streams_policy=10,
 | 
			
		||||
            edit_topic_policy=10,
 | 
			
		||||
            message_content_edit_limit_seconds=0,
 | 
			
		||||
            move_messages_within_stream_limit_seconds=0,
 | 
			
		||||
@@ -1699,7 +1698,6 @@ class RealmAPITest(ZulipTestCase):
 | 
			
		||||
            ],
 | 
			
		||||
            message_content_delete_limit_seconds=[1000, 1100, 1200],
 | 
			
		||||
            invite_to_realm_policy=Realm.INVITE_TO_REALM_POLICY_TYPES,
 | 
			
		||||
            move_messages_between_streams_policy=Realm.MOVE_MESSAGES_BETWEEN_STREAMS_POLICY_TYPES,
 | 
			
		||||
            edit_topic_policy=Realm.EDIT_TOPIC_POLICY_TYPES,
 | 
			
		||||
            message_content_edit_limit_seconds=[1000, 1100, 1200],
 | 
			
		||||
            move_messages_within_stream_limit_seconds=[1000, 1100, 1200],
 | 
			
		||||
 
 | 
			
		||||
@@ -54,7 +54,6 @@ from zerver.models.realms import (
 | 
			
		||||
    DigestWeekdayEnum,
 | 
			
		||||
    EditTopicPolicyEnum,
 | 
			
		||||
    InviteToRealmPolicyEnum,
 | 
			
		||||
    MoveMessagesBetweenStreamsPolicyEnum,
 | 
			
		||||
    OrgTypeEnum,
 | 
			
		||||
    WildcardMentionPolicyEnum,
 | 
			
		||||
)
 | 
			
		||||
@@ -149,7 +148,6 @@ def update_realm(
 | 
			
		||||
    direct_message_initiator_group: Json[GroupSettingChangeRequest] | None = None,
 | 
			
		||||
    direct_message_permission_group: Json[GroupSettingChangeRequest] | None = None,
 | 
			
		||||
    invite_to_stream_policy: Json[CommonPolicyEnum] | None = None,
 | 
			
		||||
    move_messages_between_streams_policy: Json[MoveMessagesBetweenStreamsPolicyEnum] | None = None,
 | 
			
		||||
    wildcard_mention_policy: Json[WildcardMentionPolicyEnum] | None = None,
 | 
			
		||||
    video_chat_provider: Json[int] | None = None,
 | 
			
		||||
    jitsi_server_url_raw: Annotated[
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user