Skip to content

Commit c475382

Browse files
committed
test: Add detailed example value for serverSupportedPermissionSettings
1 parent a560947 commit c475382

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

test/example_data.dart

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,65 @@ final ServerEmojiData serverEmojiDataPopularLegacy = _immutableServerEmojiData(c
192192
'1f419': ['octopus'],
193193
});
194194

195+
final supportedPermissionSettings = SupportedPermissionSettings(
196+
realm: {}, // Please go ahead and fill this in when we come to need it.
197+
group: {}, // Please go ahead and fill this in when we come to need it.
198+
stream: {
199+
// From the server's Stream.stream_permission_group_settings,
200+
// in zerver/models/streams.py. Current as of f9dc13014, 2025-08.
201+
"can_add_subscribers_group": PermissionSettingsItem(
202+
// allow_nobody_group=True,
203+
allowEveryoneGroup: false,
204+
// default_group_name=SystemGroups.NOBODY,
205+
),
206+
"can_administer_channel_group": PermissionSettingsItem(
207+
// allow_nobody_group=True,
208+
allowEveryoneGroup: false,
209+
// default_group_name="stream_creator_or_nobody",
210+
),
211+
"can_delete_any_message_group": PermissionSettingsItem(
212+
// allow_nobody_group=True,
213+
allowEveryoneGroup: true,
214+
// default_group_name=SystemGroups.NOBODY,
215+
),
216+
"can_delete_own_message_group": PermissionSettingsItem(
217+
// allow_nobody_group=True,
218+
allowEveryoneGroup: true,
219+
// default_group_name=SystemGroups.NOBODY,
220+
),
221+
"can_move_messages_out_of_channel_group": PermissionSettingsItem(
222+
// allow_nobody_group=True,
223+
allowEveryoneGroup: true,
224+
// default_group_name=SystemGroups.NOBODY,
225+
),
226+
"can_move_messages_within_channel_group": PermissionSettingsItem(
227+
// allow_nobody_group=True,
228+
allowEveryoneGroup: true,
229+
// default_group_name=SystemGroups.NOBODY,
230+
),
231+
"can_remove_subscribers_group": PermissionSettingsItem(
232+
// allow_nobody_group=True,
233+
allowEveryoneGroup: true,
234+
// default_group_name=SystemGroups.ADMINISTRATORS,
235+
),
236+
"can_send_message_group": PermissionSettingsItem(
237+
// allow_nobody_group=True,
238+
allowEveryoneGroup: true,
239+
// default_group_name=SystemGroups.EVERYONE,
240+
),
241+
"can_subscribe_group": PermissionSettingsItem(
242+
// allow_nobody_group=True,
243+
allowEveryoneGroup: false,
244+
// default_group_name=SystemGroups.NOBODY,
245+
),
246+
"can_resolve_topics_group": PermissionSettingsItem(
247+
// allow_nobody_group=True,
248+
allowEveryoneGroup: true,
249+
// default_group_name=SystemGroups.NOBODY,
250+
),
251+
},
252+
);
253+
195254
/// A fresh user-group ID, from a random but always strictly increasing sequence.
196255
int _nextUserGroupId() => (_lastUserGroupId += 1 + Random().nextInt(10));
197256
int _lastUserGroupId = 100;
@@ -1286,7 +1345,7 @@ InitialSnapshot initialSnapshot({
12861345
realmNonActiveUsers: realmNonActiveUsers ?? [],
12871346
crossRealmBots: crossRealmBots ?? [],
12881347
serverSupportedPermissionSettings: serverSupportedPermissionSettings
1289-
?? SupportedPermissionSettings(realm: {}, stream: {}, group: {}),
1348+
?? supportedPermissionSettings,
12901349
);
12911350
}
12921351
const _initialSnapshot = initialSnapshot;

0 commit comments

Comments
 (0)