diff --git a/frontend_tests/node_tests/lib/events.js b/frontend_tests/node_tests/lib/events.js index 0c1db89038..f35d67d72d 100644 --- a/frontend_tests/node_tests/lib/events.js +++ b/frontend_tests/node_tests/lib/events.js @@ -663,6 +663,7 @@ exports.fixtures = { name: "Mobile", description: "mobile folks", members: [1], + is_system_group: false, }, }, diff --git a/templates/zerver/api/changelog.md b/templates/zerver/api/changelog.md index 1628e9fcfe..afc66a5098 100644 --- a/templates/zerver/api/changelog.md +++ b/templates/zerver/api/changelog.md @@ -11,6 +11,12 @@ below features are supported. ## Changes in Zulip 5.0 +**Feature level 93** + +* [`POST /register`](/api/register-queue), [`GET /user_groups`](/api/get-user-groups), + [`GET /events`](/api/get-events): Added `is_system_group` field to user group + objects. + **Feature level 92** * [`GET /messages`](/api/get-messages), [`POST diff --git a/version.py b/version.py index 8a35bce9e0..ef4a99d3ba 100644 --- a/version.py +++ b/version.py @@ -33,7 +33,7 @@ DESKTOP_WARNING_VERSION = "5.4.3" # Changes should be accompanied by documentation explaining what the # new level means in templates/zerver/api/changelog.md, as well as # "**Changes**" entries in the endpoint's documentation in `zulip.yaml`. -API_FEATURE_LEVEL = 92 +API_FEATURE_LEVEL = 93 # Bump the minor PROVISION_VERSION to indicate that folks should provision # only when going from an old version of the code to a newer version. Bump diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index e82af0d5cc..a06617903a 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -7697,6 +7697,7 @@ def do_send_create_user_group_event(user_group: UserGroup, members: List[UserPro members=[member.id for member in members], description=user_group.description, id=user_group.id, + is_system_group=user_group.is_system_group, ), ) send_event(user_group.realm, event, active_user_ids(user_group.realm_id)) diff --git a/zerver/lib/event_schema.py b/zerver/lib/event_schema.py index 04f2dafda7..1c8ed8c3fe 100644 --- a/zerver/lib/event_schema.py +++ b/zerver/lib/event_schema.py @@ -1606,6 +1606,7 @@ group_type = DictType( ("name", str), ("members", ListType(int)), ("description", str), + ("is_system_group", bool), ] ) diff --git a/zerver/lib/user_groups.py b/zerver/lib/user_groups.py index a41b6f4467..ab1aa20972 100644 --- a/zerver/lib/user_groups.py +++ b/zerver/lib/user_groups.py @@ -40,6 +40,7 @@ def user_groups_in_realm_serialized(realm: Realm) -> List[Dict[str, Any]]: name=user_group.name, description=user_group.description, members=[], + is_system_group=user_group.is_system_group, ) membership = UserGroupMembership.objects.filter(user_group__realm=realm).values_list( diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index 46932f7d61..3e4d53c071 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -2526,6 +2526,7 @@ paths: "members": [12], "description": "Backend team", "id": 2, + "is_system_group": false, }, "id": 0, } @@ -12418,6 +12419,13 @@ paths: type: string description: | User group name. + is_system_group: + type: boolean + description: | + Whether the user group is a system group which cannot be + modified by users. + + **Changes**: New in Zulip 5.0 (feature level 93). description: | A list of `user_group` objects, which contain a `description`, a `name`, their `id` and the list of members of the user group. @@ -12432,12 +12440,14 @@ paths: "id": 1, "name": "hamletcharacters", "members": [3, 4], + "is_system_group": false, }, { "description": "Other users", "id": 2, "name": "other users", "members": [1, 2], + "is_system_group": true, }, ], } @@ -13191,6 +13201,13 @@ components: type: integer description: | The ID of the user group. + is_system_group: + type: boolean + description: | + Whether the user group is a system group which cannot be + directly modified by users. + + **Changes**: New in Zulip 5.0 (feature level 93). Subscriptions: type: object additionalProperties: false