@@ -72,6 +72,17 @@ class InitialSnapshot {
72
72
73
73
final List <UserTopicItem >? userTopics; // TODO(server-6)
74
74
75
+ final GroupSettingValue ? realmCanDeleteAnyMessageGroup; // TODO(server-10)
76
+
77
+ final GroupSettingValue ? realmCanDeleteOwnMessageGroup; // TODO(server-10)
78
+
79
+ /// The policy for who can delete their own messages,
80
+ /// on supported servers below version 10.
81
+ ///
82
+ /// Removed in FL 291, so absent in the current API doc;
83
+ /// see zulip/zulip@0cd51f2fe.
84
+ final RealmDeleteOwnMessagePolicy ? realmDeleteOwnMessagePolicy; // TODO(server-10)
85
+
75
86
/// The policy for who can use wildcard mentions in large channels.
76
87
///
77
88
/// Search for "realm_wildcard_mention_policy" in https://zulip.com/api/register-queue.
@@ -87,6 +98,8 @@ class InitialSnapshot {
87
98
/// https://zulip.com/api/roles-and-permissions#determining-if-a-user-is-a-full-member
88
99
final int realmWaitingPeriodThreshold;
89
100
101
+ final int ? realmMessageContentDeleteLimitSeconds;
102
+
90
103
final bool realmAllowMessageEditing;
91
104
final int ? realmMessageContentEditLimitSeconds;
92
105
@@ -158,9 +171,13 @@ class InitialSnapshot {
158
171
required this .userStatuses,
159
172
required this .userSettings,
160
173
required this .userTopics,
174
+ required this .realmCanDeleteAnyMessageGroup,
175
+ required this .realmCanDeleteOwnMessageGroup,
176
+ required this .realmDeleteOwnMessagePolicy,
161
177
required this .realmWildcardMentionPolicy,
162
178
required this .realmMandatoryTopics,
163
179
required this .realmWaitingPeriodThreshold,
180
+ required this .realmMessageContentDeleteLimitSeconds,
164
181
required this .realmAllowMessageEditing,
165
182
required this .realmMessageContentEditLimitSeconds,
166
183
required this .realmEnableReadReceipts,
@@ -196,6 +213,21 @@ enum RealmWildcardMentionPolicy {
196
213
int ? toJson () => apiValue;
197
214
}
198
215
216
+ @JsonEnum (valueField: 'apiValue' )
217
+ enum RealmDeleteOwnMessagePolicy {
218
+ members (apiValue: 1 ),
219
+ admins (apiValue: 2 ),
220
+ fullMembers (apiValue: 3 ),
221
+ moderators (apiValue: 4 ),
222
+ everyone (apiValue: 5 );
223
+
224
+ const RealmDeleteOwnMessagePolicy ({required this .apiValue});
225
+
226
+ final int apiValue;
227
+
228
+ int toJson () => apiValue;
229
+ }
230
+
199
231
/// An item in `realm_default_external_accounts` .
200
232
///
201
233
/// For docs, search for "realm_default_external_accounts:"
@@ -425,7 +457,141 @@ class SupportedPermissionSettings {
425
457
/// or a similar API, and switch to using that. See thread:
426
458
/// https://chat.zulip.org/#narrow/channel/378-api-design/topic/server_supported_permission_settings/near/2247549
427
459
static SupportedPermissionSettings fixture = SupportedPermissionSettings (
428
- realm: {}, // Please go ahead and fill this in when we come to need it.
460
+ realm: {
461
+ // From the server's Realm.REALM_PERMISSION_GROUP_SETTINGS,
462
+ // in zerver/models/realms.py. Current as of 6ab30fcce, 2025-08.
463
+ 'create_multiuse_invite_group' : PermissionSettingsItem (
464
+ // allow_nobody_group=True,
465
+ allowEveryoneGroup: false ,
466
+ // default_group_name=SystemGroups.ADMINISTRATORS,
467
+ ),
468
+ 'can_access_all_users_group' : PermissionSettingsItem (
469
+ // require_system_group=True,
470
+ // allow_nobody_group=False,
471
+ allowEveryoneGroup: true ,
472
+ // default_group_name=SystemGroups.EVERYONE,
473
+ // # Note that user_can_access_all_other_users in the web
474
+ // # app is relying on members always have access.
475
+ // allowed_system_groups=[SystemGroups.EVERYONE, SystemGroups.MEMBERS],
476
+ ),
477
+ 'can_add_subscribers_group' : PermissionSettingsItem (
478
+ // allow_nobody_group=True,
479
+ allowEveryoneGroup: false ,
480
+ // default_group_name=SystemGroups.MEMBERS,
481
+ ),
482
+ 'can_add_custom_emoji_group' : PermissionSettingsItem (
483
+ // allow_nobody_group=True,
484
+ allowEveryoneGroup: false ,
485
+ // default_group_name=SystemGroups.MEMBERS,
486
+ ),
487
+ 'can_create_bots_group' : PermissionSettingsItem (
488
+ // allow_nobody_group=True,
489
+ allowEveryoneGroup: false ,
490
+ // default_group_name=SystemGroups.MEMBERS,
491
+ ),
492
+ 'can_create_groups' : PermissionSettingsItem (
493
+ // allow_nobody_group=True,
494
+ allowEveryoneGroup: false ,
495
+ // default_group_name=SystemGroups.MEMBERS,
496
+ ),
497
+ 'can_create_public_channel_group' : PermissionSettingsItem (
498
+ // allow_nobody_group=True,
499
+ allowEveryoneGroup: false ,
500
+ // default_group_name=SystemGroups.MEMBERS,
501
+ ),
502
+ 'can_create_private_channel_group' : PermissionSettingsItem (
503
+ // allow_nobody_group=True,
504
+ allowEveryoneGroup: false ,
505
+ // default_group_name=SystemGroups.MEMBERS,
506
+ ),
507
+ 'can_create_web_public_channel_group' : PermissionSettingsItem (
508
+ // require_system_group=True,
509
+ // allow_nobody_group=True,
510
+ allowEveryoneGroup: false ,
511
+ // default_group_name=SystemGroups.OWNERS,
512
+ // allowed_system_groups=[
513
+ // SystemGroups.MODERATORS,
514
+ // SystemGroups.ADMINISTRATORS,
515
+ // SystemGroups.OWNERS,
516
+ // SystemGroups.NOBODY,
517
+ // ],
518
+ ),
519
+ 'can_create_write_only_bots_group' : PermissionSettingsItem (
520
+ // allow_nobody_group=True,
521
+ allowEveryoneGroup: false ,
522
+ // default_group_name=SystemGroups.MEMBERS,
523
+ ),
524
+ 'can_delete_any_message_group' : PermissionSettingsItem (
525
+ // allow_nobody_group=True,
526
+ allowEveryoneGroup: false ,
527
+ // default_group_name=SystemGroups.ADMINISTRATORS,
528
+ ),
529
+ 'can_delete_own_message_group' : PermissionSettingsItem (
530
+ // allow_nobody_group=True,
531
+ allowEveryoneGroup: true ,
532
+ // default_group_name=SystemGroups.EVERYONE,
533
+ ),
534
+ 'can_invite_users_group' : PermissionSettingsItem (
535
+ // allow_nobody_group=True,
536
+ allowEveryoneGroup: false ,
537
+ // default_group_name=SystemGroups.MEMBERS,
538
+ ),
539
+ 'can_manage_all_groups' : PermissionSettingsItem (
540
+ // allow_nobody_group=False,
541
+ allowEveryoneGroup: false ,
542
+ // default_group_name=SystemGroups.OWNERS,
543
+ ),
544
+ 'can_manage_billing_group' : PermissionSettingsItem (
545
+ // allow_nobody_group=False,
546
+ allowEveryoneGroup: false ,
547
+ // default_group_name=SystemGroups.ADMINISTRATORS,
548
+ ),
549
+ 'can_mention_many_users_group' : PermissionSettingsItem (
550
+ // allow_nobody_group=True,
551
+ allowEveryoneGroup: true ,
552
+ // default_group_name=SystemGroups.ADMINISTRATORS,
553
+ ),
554
+ 'can_move_messages_between_channels_group' : PermissionSettingsItem (
555
+ // allow_nobody_group=True,
556
+ allowEveryoneGroup: false ,
557
+ // default_group_name=SystemGroups.MEMBERS,
558
+ ),
559
+ 'can_move_messages_between_topics_group' : PermissionSettingsItem (
560
+ // allow_nobody_group=True,
561
+ allowEveryoneGroup: true ,
562
+ // default_group_name=SystemGroups.EVERYONE,
563
+ ),
564
+ 'can_resolve_topics_group' : PermissionSettingsItem (
565
+ // allow_nobody_group=True,
566
+ allowEveryoneGroup: true ,
567
+ // default_group_name=SystemGroups.EVERYONE,
568
+ ),
569
+ 'can_set_delete_message_policy_group' : PermissionSettingsItem (
570
+ // allow_nobody_group=True,
571
+ allowEveryoneGroup: false ,
572
+ // default_group_name=SystemGroups.MODERATORS,
573
+ ),
574
+ 'can_set_topics_policy_group' : PermissionSettingsItem (
575
+ // allow_nobody_group=True,
576
+ allowEveryoneGroup: true ,
577
+ // default_group_name=SystemGroups.MEMBERS,
578
+ ),
579
+ 'can_summarize_topics_group' : PermissionSettingsItem (
580
+ // allow_nobody_group=True,
581
+ allowEveryoneGroup: true ,
582
+ // default_group_name=SystemGroups.EVERYONE,
583
+ ),
584
+ 'direct_message_initiator_group' : PermissionSettingsItem (
585
+ // allow_nobody_group=True,
586
+ allowEveryoneGroup: true ,
587
+ // default_group_name=SystemGroups.EVERYONE,
588
+ ),
589
+ 'direct_message_permission_group' : PermissionSettingsItem (
590
+ // allow_nobody_group=True,
591
+ allowEveryoneGroup: true ,
592
+ // default_group_name=SystemGroups.EVERYONE,
593
+ ),
594
+ },
429
595
group: {}, // Please go ahead and fill this in when we come to need it.
430
596
stream: {
431
597
// From the server's Stream.stream_permission_group_settings,
0 commit comments