diff --git a/.github/workflows/integration-mariadb.yml b/.github/workflows/integration-mariadb.yml index 8d3f5461b1c..0f3fd2149df 100644 --- a/.github/workflows/integration-mariadb.yml +++ b/.github/workflows/integration-mariadb.yml @@ -52,7 +52,7 @@ jobs: strategy: fail-fast: false matrix: - test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] + test-suite: ['callapi', 'chat-1', 'chat-2', 'chat-3', 'chat-4', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] php-versions: ['8.2'] server-versions: ['master'] guests-versions: ['master'] diff --git a/.github/workflows/integration-mysql.yml b/.github/workflows/integration-mysql.yml index 97beff23101..05197044bcf 100644 --- a/.github/workflows/integration-mysql.yml +++ b/.github/workflows/integration-mysql.yml @@ -52,7 +52,7 @@ jobs: strategy: fail-fast: false matrix: - test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] + test-suite: ['callapi', 'chat-1', 'chat-2', 'chat-3', 'chat-4', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] php-versions: ['8.2'] server-versions: ['master'] guests-versions: ['master'] diff --git a/.github/workflows/integration-oci.yml b/.github/workflows/integration-oci.yml index 27f092190c8..969b420aace 100644 --- a/.github/workflows/integration-oci.yml +++ b/.github/workflows/integration-oci.yml @@ -52,7 +52,7 @@ jobs: strategy: fail-fast: false matrix: - test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] + test-suite: ['callapi', 'chat-1', 'chat-2', 'chat-3', 'chat-4', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] php-versions: ['8.2'] server-versions: ['master'] guests-versions: ['master'] diff --git a/.github/workflows/integration-pgsql.yml b/.github/workflows/integration-pgsql.yml index b5f5dc0ff8d..b4b121a9d8d 100644 --- a/.github/workflows/integration-pgsql.yml +++ b/.github/workflows/integration-pgsql.yml @@ -49,7 +49,7 @@ jobs: strategy: fail-fast: false matrix: - test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] + test-suite: ['callapi', 'chat-1', 'chat-2', 'chat-3', 'chat-4', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] php-versions: ['8.3'] server-versions: ['master'] guests-versions: ['master'] diff --git a/.github/workflows/integration-sqlite.yml b/.github/workflows/integration-sqlite.yml index cb7641e3d46..506cf06b236 100644 --- a/.github/workflows/integration-sqlite.yml +++ b/.github/workflows/integration-sqlite.yml @@ -52,7 +52,7 @@ jobs: strategy: fail-fast: false matrix: - test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] + test-suite: ['callapi', 'chat-1', 'chat-2', 'chat-3', 'chat-4', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] php-versions: ['8.2'] server-versions: ['master'] guests-versions: ['master'] @@ -115,7 +115,7 @@ jobs: coverage: none ini-file: development # Temporary workaround for missing pcntl_* in PHP 8.3: ini-values: apc.enable_cli=on - ini-values: apc.enable_cli=on, disable_functions= + ini-values: apc.enable_cli=on, disable_functions= env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -136,7 +136,7 @@ jobs: ./occ config:system:set debug --value=true --type=boolean ./occ config:system:set hashing_default_password --value=true --type=boolean ./occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu" - ./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu" + ./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu" ./occ app:enable --force ${{ env.APP_NAME }} ./occ app:enable --force call_summary_bot ./occ app:enable --force circles diff --git a/docs/conversation.md b/docs/conversation.md index e9888b81725..1988612ecd7 100644 --- a/docs/conversation.md +++ b/docs/conversation.md @@ -352,7 +352,7 @@ Get all (for moderators and in case of "free selection") or the assigned breakou | field | type | Description | |---------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `mode` | string | `default` or `call`, in case of call the permissions will be reset to `0` (default) after the end of a call. | +| `mode` | string | `default` or `call`, in case of call the permissions will be reset to `0` (default) after the end of a call. (🏁 `call` is no-op since Talk 20) | | `permissions` | int | New permissions for the attendees, see [constants list](constants.md#attendee-permissions). If permissions are not `0` (default), the `1` (custom) permission will always be added. Note that this will reset all custom permissions that have been given to attendees so far. | * Response: diff --git a/docs/participant.md b/docs/participant.md index 157f420fa27..6ff34c1d893 100644 --- a/docs/participant.md +++ b/docs/participant.md @@ -253,6 +253,7 @@ Setting custom permissions for a self-joined user will also make them a permanen ## Set permissions for all attendees +* Deprecated: 🏁 The API is no-op since Talk 20 * Method: `PUT` * Endpoint: `/room/{token}/attendees/permissions/all` * Data: diff --git a/lib/Controller/CallController.php b/lib/Controller/CallController.php index 37333791359..babc5d2074f 100644 --- a/lib/Controller/CallController.php +++ b/lib/Controller/CallController.php @@ -116,8 +116,6 @@ public function getPeersForCall(): DataResponse { * * @param int<0, 15>|null $flags In-Call flags * @psalm-param int-mask-of|null $flags - * @param int<0, 255>|null $forcePermissions In-call permissions - * @psalm-param int-mask-of|null $forcePermissions * @param bool $silent Join the call silently * @param bool $recordingConsent When the user ticked a checkbox and agreed with being recorded * (Only needed when the `config => call => recording-consent` capability is set to {@see RecordingService::CONSENT_REQUIRED_YES} @@ -135,7 +133,7 @@ public function getPeersForCall(): DataResponse { #[RequireModeratorOrNoLobby] #[RequireParticipant] #[RequireReadWriteConversation] - public function joinCall(?int $flags = null, ?int $forcePermissions = null, bool $silent = false, bool $recordingConsent = false): DataResponse { + public function joinCall(?int $flags = null, bool $silent = false, bool $recordingConsent = false): DataResponse { try { $this->validateRecordingConsent($recordingConsent); } catch (\InvalidArgumentException) { @@ -166,10 +164,6 @@ public function joinCall(?int $flags = null, ?int $forcePermissions = null, bool return $response; } - if ($forcePermissions !== null && $this->participant->hasModeratorPermissions()) { - $this->roomService->setPermissions($this->room, 'call', Attendee::PERMISSIONS_MODIFY_SET, $forcePermissions, true); - } - try { $this->participantService->changeInCall($this->room, $this->participant, $flags, silent: $silent); $this->roomService->setActiveSince($this->room, $this->participant, $this->timeFactory->getDateTime(), $flags, silent: $silent); diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 0f20d346946..b4397b33fe7 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -2108,10 +2108,10 @@ protected function changeParticipantType(int $attendeeId, bool $promote): DataRe /** * Update the permissions of a room * - * @param 'call'|'default' $mode Level of the permissions ('call', 'default') + * @param 'call'|'default' $mode Level of the permissions ('call' (removed in Talk 20), 'default') * @param int<0, 255> $permissions New permissions * @psalm-param int-mask-of $permissions - * @return DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse * * 200: Permissions updated successfully * 400: Updating permissions is not possible @@ -2119,8 +2119,16 @@ protected function changeParticipantType(int $attendeeId, bool $promote): DataRe #[PublicPage] #[RequireModeratorParticipant] public function setPermissions(string $mode, int $permissions): DataResponse { - if (!$this->roomService->setPermissions($this->room, $mode, Attendee::PERMISSIONS_MODIFY_SET, $permissions, true)) { - return new DataResponse([], Http::STATUS_BAD_REQUEST); + if ($mode !== 'default') { + return new DataResponse(['error' => 'mode'], Http::STATUS_BAD_REQUEST); + } + + try { + $this->roomService->setDefaultPermissions($this->room, $permissions); + } catch (\InvalidArgumentException $e) { + /** @var 'breakout-room'|'type' $error */ + $error = $e->getMessage(); + return new DataResponse(['error' => $error], Http::STATUS_BAD_REQUEST); } return new DataResponse($this->formatRoom($this->room, $this->participant)); @@ -2171,6 +2179,7 @@ public function setAttendeePermissions(int $attendeeId, string $method, int $per * @param int<0, 255> $permissions New permissions * @psalm-param int-mask-of $permissions * @return DataResponse|DataResponse, array{}> + * @deprecated Call permissions have been removed * * 200: Permissions updated successfully * 400: Updating permissions is not possible diff --git a/lib/Events/ARoomModifiedEvent.php b/lib/Events/ARoomModifiedEvent.php index dd20d45e266..72a8f415df1 100644 --- a/lib/Events/ARoomModifiedEvent.php +++ b/lib/Events/ARoomModifiedEvent.php @@ -16,6 +16,7 @@ abstract class ARoomModifiedEvent extends ARoomEvent { public const PROPERTY_AVATAR = 'avatar'; public const PROPERTY_BREAKOUT_ROOM_MODE = 'breakoutRoomMode'; public const PROPERTY_BREAKOUT_ROOM_STATUS = 'breakoutRoomStatus'; + /** @deprecated */ public const PROPERTY_CALL_PERMISSIONS = 'callPermissions'; public const PROPERTY_CALL_RECORDING = 'callRecording'; public const PROPERTY_DEFAULT_PERMISSIONS = 'defaultPermissions'; diff --git a/lib/Participant.php b/lib/Participant.php index 9f9963da466..11f6f7364fd 100644 --- a/lib/Participant.php +++ b/lib/Participant.php @@ -121,11 +121,6 @@ protected function getPermissionsFromFallbackChain(): int { return $this->getAttendee()->getPermissions(); } - if ($this->room->getCallPermissions() !== Attendee::PERMISSIONS_DEFAULT) { - // The currently ongoing call is in a special mode - return $this->room->getCallPermissions(); - } - if ($this->room->getDefaultPermissions() !== Attendee::PERMISSIONS_DEFAULT) { // The conversation has some permissions set return $this->room->getDefaultPermissions(); diff --git a/lib/Room.php b/lib/Room.php index 40bbc7ca8b7..3c1a6d0d021 100644 --- a/lib/Room.php +++ b/lib/Room.php @@ -307,10 +307,16 @@ public function setDefaultPermissions(int $defaultPermissions): void { $this->defaultPermissions = $defaultPermissions; } + /** + * @deprecated + */ public function getCallPermissions(): int { - return $this->callPermissions; + return Attendee::PERMISSIONS_DEFAULT; } + /** + * @deprecated + */ public function setCallPermissions(int $callPermissions): void { $this->callPermissions = $callPermissions; } diff --git a/lib/Service/RoomFormatter.php b/lib/Service/RoomFormatter.php index 2b0f5127a10..00b56910649 100644 --- a/lib/Service/RoomFormatter.php +++ b/lib/Service/RoomFormatter.php @@ -215,7 +215,7 @@ public function formatRoomV4( 'attendeeId' => $attendee->getId(), 'permissions' => $currentParticipant->getPermissions(), 'attendeePermissions' => $attendee->getPermissions(), - 'callPermissions' => $room->getCallPermissions(), + 'callPermissions' => Attendee::PERMISSIONS_DEFAULT, 'defaultPermissions' => $room->getDefaultPermissions(), 'description' => $room->getDescription(), 'listable' => $room->getListable(), diff --git a/lib/Service/RoomService.php b/lib/Service/RoomService.php index 1ecbd529bec..95921ec4ad9 100644 --- a/lib/Service/RoomService.php +++ b/lib/Service/RoomService.php @@ -169,78 +169,60 @@ public function prepareConversationName(string $objectName): string { return rtrim(mb_substr(ltrim($objectName), 0, 64)); } + /** + * @deprecated + */ public function setPermissions(Room $room, string $level, string $method, int $permissions, bool $resetCustomPermissions): bool { - if ($room->getType() === Room::TYPE_ONE_TO_ONE || $room->getType() === Room::TYPE_ONE_TO_ONE_FORMER) { - return false; + if ($level === 'default' && $method === 'set') { + try { + $this->setDefaultPermissions($room, $permissions); + return true; + } catch (InvalidArgumentException) { + return false; + + } } + return false; + } - if ($room->getType() === Room::TYPE_NOTE_TO_SELF) { - return false; + /** + * @throws InvalidArgumentException + */ + public function setDefaultPermissions(Room $room, int $permissions): void { + if ($room->getType() === Room::TYPE_ONE_TO_ONE + || $room->getType() === Room::TYPE_ONE_TO_ONE_FORMER + || $room->getType() === Room::TYPE_NOTE_TO_SELF) { + throw new \InvalidArgumentException('type'); } if ($room->getObjectType() === BreakoutRoom::PARENT_OBJECT_TYPE) { // Do not allow manual changing the permissions in breakout rooms - return false; - } - - if ($level === 'default') { - $property = ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS; - $oldPermissions = $room->getDefaultPermissions(); - } elseif ($level === 'call') { - $property = ARoomModifiedEvent::PROPERTY_CALL_PERMISSIONS; - $oldPermissions = $room->getCallPermissions(); - - if ($oldPermissions === Attendee::PERMISSIONS_DEFAULT - && ($method === Attendee::PERMISSIONS_MODIFY_ADD - || $method === Attendee::PERMISSIONS_MODIFY_REMOVE)) { - $oldPermissions = $room->getDefaultPermissions(); - } - } else { - return false; + throw new InvalidArgumentException('breakout-room'); } + $oldPermissions = $room->getDefaultPermissions(); $newPermissions = $permissions; - if ($method === Attendee::PERMISSIONS_MODIFY_SET) { - if ($newPermissions !== Attendee::PERMISSIONS_DEFAULT) { - // Make sure the custom flag is set when not setting to default permissions - $newPermissions |= Attendee::PERMISSIONS_CUSTOM; - } - // If we are setting a fixed set of permissions and apply that to users, - // we can also simplify it and reset to default. - $resetCustomPermissions = true; - } elseif ($method === Attendee::PERMISSIONS_MODIFY_ADD) { - $newPermissions = $oldPermissions | $newPermissions; - } elseif ($method === Attendee::PERMISSIONS_MODIFY_REMOVE) { - $newPermissions = $oldPermissions & ~$newPermissions; - } else { - return false; + if ($newPermissions !== Attendee::PERMISSIONS_DEFAULT) { + // Make sure the custom flag is set when not setting to default permissions + $newPermissions |= Attendee::PERMISSIONS_CUSTOM; } - $event = new BeforeRoomModifiedEvent($room, $property, $newPermissions, $oldPermissions); + $event = new BeforeRoomModifiedEvent($room, ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS, $newPermissions, $oldPermissions); $this->dispatcher->dispatchTyped($event); - if ($resetCustomPermissions) { - $this->participantService->updateAllPermissions($room, Attendee::PERMISSIONS_MODIFY_SET, Attendee::PERMISSIONS_DEFAULT); - } else { - $this->participantService->updateAllPermissions($room, $method, $permissions); - } + // Reset custom user permissions to default + $this->participantService->updateAllPermissions($room, Attendee::PERMISSIONS_MODIFY_SET, Attendee::PERMISSIONS_DEFAULT); $update = $this->db->getQueryBuilder(); $update->update('talk_rooms') - ->set($level . '_permissions', $update->createNamedParameter($newPermissions, IQueryBuilder::PARAM_INT)) + ->set('default_permissions', $update->createNamedParameter($newPermissions, IQueryBuilder::PARAM_INT)) ->where($update->expr()->eq('id', $update->createNamedParameter($room->getId(), IQueryBuilder::PARAM_INT))); $update->executeStatement(); - if ($level === 'default') { - $room->setDefaultPermissions($newPermissions); - } else { - $room->setCallPermissions($newPermissions); - } + $room->setDefaultPermissions($newPermissions); - $event = new RoomModifiedEvent($room, $property, $newPermissions, $oldPermissions); + $event = new RoomModifiedEvent($room, ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS, $newPermissions, $oldPermissions); $this->dispatcher->dispatchTyped($event); - - return true; } public function setSIPEnabled(Room $room, int $newSipEnabled): bool { @@ -875,7 +857,6 @@ public function resetActiveSinceInDatabaseOnly(Room $room): bool { */ public function resetActiveSinceInModelOnly(Room $room): void { $room->resetActiveSince(); - $room->setCallPermissions(Attendee::PERMISSIONS_DEFAULT); } public function resetActiveSince(Room $room, ?Participant $participant): void { @@ -1055,11 +1036,11 @@ public function syncPropertiesFromHostRoom(Room $local, array $host): void { } } if (isset($host['defaultPermissions']) && $host['defaultPermissions'] !== $local->getDefaultPermissions()) { - $success = $this->setPermissions($local, 'default', Attendee::PERMISSIONS_MODIFY_SET, $host['defaultPermissions'], false); - if (!$success) { - $this->logger->error('An error occurred while trying to sync defaultPermissions of ' . $local->getId() . ' to ' . $host['defaultPermissions']); - } else { + try { + $this->setDefaultPermissions($local, $host['defaultPermissions']); $changed[] = ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS; + } catch (\InvalidArgumentException $e) { + $this->logger->error('An error (' . $e->getMessage() . ') occurred while trying to sync defaultPermissions of ' . $local->getId() . ' to ' . $host['defaultPermissions'], ['exception' => $e]); } } if (isset($host['avatarVersion']) && $host['avatarVersion'] !== $local->getAvatar()) { diff --git a/lib/Signaling/Listener.php b/lib/Signaling/Listener.php index 6d4a9fa2d73..f2bddcd5899 100644 --- a/lib/Signaling/Listener.php +++ b/lib/Signaling/Listener.php @@ -51,7 +51,6 @@ class Listener implements IEventListener { ARoomModifiedEvent::PROPERTY_BREAKOUT_ROOM_MODE, ARoomModifiedEvent::PROPERTY_BREAKOUT_ROOM_STATUS, ARoomModifiedEvent::PROPERTY_CALL_RECORDING, - ARoomModifiedEvent::PROPERTY_CALL_PERMISSIONS, ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS, ARoomModifiedEvent::PROPERTY_DESCRIPTION, ARoomModifiedEvent::PROPERTY_LISTABLE, @@ -114,7 +113,6 @@ protected function refreshParticipantListParticipantModified(ParticipantModified protected function refreshParticipantListRoomModified(RoomModifiedEvent $event): void { if (!in_array($event->getProperty(), [ - ARoomModifiedEvent::PROPERTY_CALL_PERMISSIONS, ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS, ], true)) { return; @@ -153,8 +151,7 @@ protected function notifyRoomModified(ARoomModifiedEvent $event): void { return; } - if ($event->getProperty() === ARoomModifiedEvent::PROPERTY_CALL_PERMISSIONS - || $event->getProperty() === ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS) { + if ($event->getProperty() === ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS) { $this->notifyRoomPermissionsModified($event); // The room permission itself does not need a signaling message anymore return; @@ -175,8 +172,7 @@ protected function notifyRoomSynced(RoomSyncedEvent $event): void { return; } - if (in_array(ARoomModifiedEvent::PROPERTY_CALL_PERMISSIONS, $event->getProperties(), true) - || in_array(ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS, $event->getProperties(), true)) { + if (in_array(ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS, $event->getProperties(), true)) { $this->notifyRoomPermissionsModified($event); } diff --git a/openapi-full.json b/openapi-full.json index 28f02fa4ee3..f60814e70c5 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -4071,14 +4071,6 @@ "minimum": 0, "maximum": 15 }, - "forcePermissions": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "In-call permissions", - "minimum": 0, - "maximum": 255 - }, "silent": { "type": "boolean", "default": false, @@ -12138,7 +12130,7 @@ { "name": "mode", "in": "path", - "description": "Level of the permissions ('call', 'default')", + "description": "Level of the permissions ('call' (removed in Talk 20), 'default')", "required": true, "schema": { "type": "string", @@ -12211,7 +12203,22 @@ "meta": { "$ref": "#/components/schemas/OCSMeta" }, - "data": {} + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string", + "enum": [ + "breakout-room", + "mode", + "type" + ] + } + } + } } } } @@ -13268,6 +13275,7 @@ "put": { "operationId": "room-set-all-attendees-permissions", "summary": "Update the permissions of all attendees", + "deprecated": true, "tags": [ "room" ], diff --git a/openapi.json b/openapi.json index 78a7d6ef83c..133cc412a48 100644 --- a/openapi.json +++ b/openapi.json @@ -3958,14 +3958,6 @@ "minimum": 0, "maximum": 15 }, - "forcePermissions": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "In-call permissions", - "minimum": 0, - "maximum": 255 - }, "silent": { "type": "boolean", "default": false, @@ -12258,7 +12250,7 @@ { "name": "mode", "in": "path", - "description": "Level of the permissions ('call', 'default')", + "description": "Level of the permissions ('call' (removed in Talk 20), 'default')", "required": true, "schema": { "type": "string", @@ -12331,7 +12323,22 @@ "meta": { "$ref": "#/components/schemas/OCSMeta" }, - "data": {} + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string", + "enum": [ + "breakout-room", + "mode", + "type" + ] + } + } + } } } } @@ -13388,6 +13395,7 @@ "put": { "operationId": "room-set-all-attendees-permissions", "summary": "Update the permissions of all attendees", + "deprecated": true, "tags": [ "room" ], diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index 2f5a9b881db..1b7b0015fa7 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -983,7 +983,10 @@ export type paths = { cookie?: never; }; get?: never; - /** Update the permissions of all attendees */ + /** + * Update the permissions of all attendees + * @deprecated + */ put: operations["room-set-all-attendees-permissions"]; post?: never; delete?: never; @@ -3277,11 +3280,6 @@ export interface operations { * @description In-Call flags */ flags?: number | null; - /** - * Format: int64 - * @description In-call permissions - */ - forcePermissions?: number | null; /** * @description Join the call silently * @default false @@ -6476,7 +6474,7 @@ export interface operations { path: { apiVersion: "v4"; token: string; - /** @description Level of the permissions ('call', 'default') */ + /** @description Level of the permissions ('call' (removed in Talk 20), 'default') */ mode: "call" | "default"; }; cookie?: never; @@ -6516,7 +6514,10 @@ export interface operations { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: unknown; + data: { + /** @enum {string} */ + error: "breakout-room" | "mode" | "type"; + }; }; }; }; diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 6c90af53ad0..418bd57fbb3 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -985,7 +985,10 @@ export type paths = { cookie?: never; }; get?: never; - /** Update the permissions of all attendees */ + /** + * Update the permissions of all attendees + * @deprecated + */ put: operations["room-set-all-attendees-permissions"]; post?: never; delete?: never; @@ -2758,11 +2761,6 @@ export interface operations { * @description In-Call flags */ flags?: number | null; - /** - * Format: int64 - * @description In-call permissions - */ - forcePermissions?: number | null; /** * @description Join the call silently * @default false @@ -6054,7 +6052,7 @@ export interface operations { path: { apiVersion: "v4"; token: string; - /** @description Level of the permissions ('call', 'default') */ + /** @description Level of the permissions ('call' (removed in Talk 20), 'default') */ mode: "call" | "default"; }; cookie?: never; @@ -6094,7 +6092,10 @@ export interface operations { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: unknown; + data: { + /** @enum {string} */ + error: "breakout-room" | "mode" | "type"; + }; }; }; }; diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index a2cd34047e9..517a4c3dbe7 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -2039,41 +2039,6 @@ public function userSetsPermissionsForInRoomTo(string $user, string $participant $this->assertStatusCode($this->response, $statusCode); } - /** - * @When /^user "([^"]*)" (sets|removes|adds) permissions for all attendees in room "([^"]*)" to "([^"]*)" with (\d+) \((v4)\)$/ - * - * @param string $user - * @param string $mode - * @param string $identifier - * @param string $permissionsString - * @param int $statusCode - * @param string $apiVersion - */ - public function userSetsRemovesAddsPermissionsForAllAttendeesInRoomTo(string $user, string $method, string $identifier, string $permissionsString, int $statusCode, string $apiVersion): void { - $permissions = $this->mapPermissionsTestInput($permissionsString); - - // Convert method from step syntax to what the API expects - if ($method === 'sets') { - $method = 'set'; - } elseif ($method === 'removes') { - $method = 'remove'; - } else { - $method = 'add'; - } - - $requestParameters = [ - ['method', $method], - ['permissions', $permissions], - ]; - - $this->setCurrentUser($user); - $this->sendRequest( - 'PUT', '/apps/spreed/api/' . $apiVersion . '/room/' . self::$identifierToToken[$identifier] . '/attendees/permissions/all', - new TableNode($requestParameters) - ); - $this->assertStatusCode($this->response, $statusCode); - } - /** * @When /^user "([^"]*)" sets (call|default) permissions for room "([^"]*)" to "([^"]*)" with (\d+) \((v4)\)$/ * diff --git a/tests/integration/features/chat-1/bots.feature b/tests/integration/features/chat-2/bots.feature similarity index 100% rename from tests/integration/features/chat-1/bots.feature rename to tests/integration/features/chat-2/bots.feature diff --git a/tests/integration/features/chat-1/mentions.feature b/tests/integration/features/chat-2/mentions.feature similarity index 100% rename from tests/integration/features/chat-1/mentions.feature rename to tests/integration/features/chat-2/mentions.feature diff --git a/tests/integration/features/chat-2/poll.feature b/tests/integration/features/chat-3/poll.feature similarity index 100% rename from tests/integration/features/chat-2/poll.feature rename to tests/integration/features/chat-3/poll.feature diff --git a/tests/integration/features/chat-2/public-read-only.feature b/tests/integration/features/chat-3/public-read-only.feature similarity index 100% rename from tests/integration/features/chat-2/public-read-only.feature rename to tests/integration/features/chat-3/public-read-only.feature diff --git a/tests/integration/features/chat-2/public.feature b/tests/integration/features/chat-3/public.feature similarity index 100% rename from tests/integration/features/chat-2/public.feature rename to tests/integration/features/chat-3/public.feature diff --git a/tests/integration/features/chat-2/reaction.feature b/tests/integration/features/chat-3/reaction.feature similarity index 100% rename from tests/integration/features/chat-2/reaction.feature rename to tests/integration/features/chat-3/reaction.feature diff --git a/tests/integration/features/chat-2/read-status.feature b/tests/integration/features/chat-3/read-status.feature similarity index 100% rename from tests/integration/features/chat-2/read-status.feature rename to tests/integration/features/chat-3/read-status.feature diff --git a/tests/integration/features/chat-2/reference-id.feature b/tests/integration/features/chat-3/reference-id.feature similarity index 100% rename from tests/integration/features/chat-2/reference-id.feature rename to tests/integration/features/chat-3/reference-id.feature diff --git a/tests/integration/features/chat-2/reminder.feature b/tests/integration/features/chat-3/reminder.feature similarity index 100% rename from tests/integration/features/chat-2/reminder.feature rename to tests/integration/features/chat-3/reminder.feature diff --git a/tests/integration/features/chat-2/reply.feature b/tests/integration/features/chat-4/reply.feature similarity index 100% rename from tests/integration/features/chat-2/reply.feature rename to tests/integration/features/chat-4/reply.feature diff --git a/tests/integration/features/chat-2/rich-messages.feature b/tests/integration/features/chat-4/rich-messages.feature similarity index 100% rename from tests/integration/features/chat-2/rich-messages.feature rename to tests/integration/features/chat-4/rich-messages.feature diff --git a/tests/integration/features/chat-2/rich-object-share.feature b/tests/integration/features/chat-4/rich-object-share.feature similarity index 100% rename from tests/integration/features/chat-2/rich-object-share.feature rename to tests/integration/features/chat-4/rich-object-share.feature diff --git a/tests/integration/features/chat-2/search.feature b/tests/integration/features/chat-4/search.feature similarity index 100% rename from tests/integration/features/chat-2/search.feature rename to tests/integration/features/chat-4/search.feature diff --git a/tests/integration/features/chat-2/system-messages.feature b/tests/integration/features/chat-4/system-messages.feature similarity index 100% rename from tests/integration/features/chat-2/system-messages.feature rename to tests/integration/features/chat-4/system-messages.feature diff --git a/tests/integration/features/chat-2/typing-privacy.feature b/tests/integration/features/chat-4/typing-privacy.feature similarity index 100% rename from tests/integration/features/chat-2/typing-privacy.feature rename to tests/integration/features/chat-4/typing-privacy.feature diff --git a/tests/integration/features/chat-2/unread-messages.feature b/tests/integration/features/chat-4/unread-messages.feature similarity index 100% rename from tests/integration/features/chat-2/unread-messages.feature rename to tests/integration/features/chat-4/unread-messages.feature diff --git a/tests/integration/features/conversation-1/bruteforce-protection.feature b/tests/integration/features/conversation-5/bruteforce-protection.feature similarity index 100% rename from tests/integration/features/conversation-1/bruteforce-protection.feature rename to tests/integration/features/conversation-5/bruteforce-protection.feature diff --git a/tests/integration/features/conversation-1/delete-room.feature b/tests/integration/features/conversation-5/delete-room.feature similarity index 100% rename from tests/integration/features/conversation-1/delete-room.feature rename to tests/integration/features/conversation-5/delete-room.feature diff --git a/tests/integration/features/conversation-1/delete-user.feature b/tests/integration/features/conversation-5/delete-user.feature similarity index 100% rename from tests/integration/features/conversation-1/delete-user.feature rename to tests/integration/features/conversation-5/delete-user.feature diff --git a/tests/integration/features/conversation-5/set-permissions.feature b/tests/integration/features/conversation-5/set-permissions.feature index 31ac6733248..81d16763577 100644 --- a/tests/integration/features/conversation-5/set-permissions.feature +++ b/tests/integration/features/conversation-5/set-permissions.feature @@ -35,22 +35,6 @@ Feature: conversation-2/set-publishing-permissions | users | moderator | SJLAVPM | | users | invited user | CAV | - Scenario: Owner and moderators can set call permissions users can not - Given user "owner" creates room "group room" (v4) - | roomType | 2 | - | roomName | room | - And user "owner" adds user "moderator" to room "group room" with 200 (v4) - And user "owner" promotes "moderator" in room "group room" with 200 (v4) - And user "owner" adds user "invited user" to room "group room" with 200 (v4) - When user "owner" sets call permissions for room "group room" to "S" with 200 (v4) - When user "moderator" sets call permissions for room "group room" to "AV" with 200 (v4) - When user "invited user" sets call permissions for room "group room" to "D" with 403 (v4) - Then user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | permissions | - | users | owner | SJLAVPM | - | users | moderator | SJLAVPM | - | users | invited user | CAV | - Scenario: User setting over call setting over conversation setting over default Given user "owner" creates room "group room" (v4) | roomType | 2 | @@ -61,22 +45,12 @@ Feature: conversation-2/set-publishing-permissions | actorType | actorId | permissions | | users | owner | SJLAVPM | | users | invited user | CS | - When user "owner" sets call permissions for room "group room" to "A" with 200 (v4) - Then user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | permissions | - | users | owner | SJLAVPM | - | users | invited user | CA | And user "owner" sets permissions for "invited user" in room "group room" to "V" with 200 (v4) Then user "owner" sees the following attendees in room "group room" with 200 (v4) | actorType | actorId | permissions | | users | owner | SJLAVPM | | users | invited user | CV | And user "owner" sets permissions for "invited user" in room "group room" to "D" with 200 (v4) - Then user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | permissions | - | users | owner | SJLAVPM | - | users | invited user | CA | - When user "owner" sets call permissions for room "group room" to "D" with 200 (v4) Then user "owner" sees the following attendees in room "group room" with 200 (v4) | actorType | actorId | permissions | | users | owner | SJLAVPM | @@ -87,22 +61,6 @@ Feature: conversation-2/set-publishing-permissions | users | owner | SJLAVPM | | users | invited user | SJAVPM | - Scenario: setting call permissions resets participant permissions - Given user "owner" creates room "group room" (v4) - | roomType | 2 | - | roomName | room | - And user "owner" adds user "invited user" to room "group room" with 200 (v4) - And user "owner" sets permissions for "invited user" in room "group room" to "V" with 200 (v4) - And user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | permissions | attendeePermissions | - | users | owner | SJLAVPM | D | - | users | invited user | CV | CV | - When user "owner" sets call permissions for room "group room" to "A" with 200 (v4) - Then user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | permissions | attendeePermissions | - | users | owner | SJLAVPM | D | - | users | invited user | CA | D | - Scenario: setting default permissions resets participant permissions Given user "owner" creates room "group room" (v4) | roomType | 2 | @@ -119,22 +77,6 @@ Feature: conversation-2/set-publishing-permissions | users | owner | SJLAVPM | D | | users | invited user | CA | D | - Scenario: setting default permissions does not reset call permissions - Given user "owner" creates room "group room" (v4) - | roomType | 2 | - | roomName | room | - And user "owner" adds user "invited user" to room "group room" with 200 (v4) - And user "owner" sets call permissions for room "group room" to "V" with 200 (v4) - And user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | permissions | attendeePermissions | - | users | owner | SJLAVPM | D | - | users | invited user | CV | D | - When user "owner" sets default permissions for room "group room" to "A" with 200 (v4) - Then user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | permissions | attendeePermissions | - | users | owner | SJLAVPM | D | - | users | invited user | CV | D | - Scenario: setting permissions for a self joined user adds them permanently Given user "owner" creates room "room" (v4) | roomType | 3 | @@ -149,39 +91,3 @@ Feature: conversation-2/set-publishing-permissions | actorType | actorId | permissions | attendeePermissions | participantType | | users | owner | SJLAVPM | D | 1 | | users | invited user | CLAVPM | CLAVPM | 3 | - - Scenario: adding and removing permissions to all attendees do not change default attendee permissions - Given user "invited user2" exists - And user "owner" creates room "group room" (v4) - | roomType | 2 | - | roomName | room | - And user "owner" adds user "invited user" to room "group room" with 200 (v4) - And user "owner" adds user "invited user2" to room "group room" with 200 (v4) - And user "owner" sets call permissions for room "group room" to "LPM" with 200 (v4) - And user "owner" sets permissions for "invited user2" in room "group room" to "LVP" with 200 (v4) - When user "owner" adds permissions for all attendees in room "group room" to "JA" with 200 (v4) - And user "owner" removes permissions for all attendees in room "group room" to "SLP" with 200 (v4) - Then user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | permissions | attendeePermissions | - | users | owner | SJLAVPM | D | - | users | invited user | CJAM | D | - | users | invited user2 | CJAV | CJAV | - And user "owner" is participant of room "group room" (v4) - | callPermissions | defaultPermissions | - | CJAM | D | - - Scenario: adding and removing permissions to all attendees customize room permissions if call permissions are not set - Given user "owner" creates room "group room" (v4) - | roomType | 2 | - | roomName | room | - And user "owner" adds user "invited user" to room "group room" with 200 (v4) - And user "owner" sets default permissions for room "group room" to "LPM" with 200 (v4) - When user "owner" adds permissions for all attendees in room "group room" to "JA" with 200 (v4) - And user "owner" removes permissions for all attendees in room "group room" to "SLP" with 200 (v4) - Then user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | permissions | attendeePermissions | - | users | owner | SJLAVPM | D | - | users | invited user | CJAM | D | - And user "owner" is participant of room "group room" (v4) - | callPermissions | defaultPermissions | - | CJAM | CLPM |