diff options
24 files changed, 366 insertions, 235 deletions
diff --git a/appinfo/routes.php b/appinfo/routes.php index dfc8ebdb8..2ef993e5a 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -355,22 +355,20 @@ return [ ], [ 'name' => 'Room#setAttendeePermissions', - 'url' => '/api/{apiVersion}/room/{token}/attendees/{permissions}', + 'url' => '/api/{apiVersion}/room/{token}/attendees/permissions', 'verb' => 'PUT', 'requirements' => [ 'apiVersion' => 'v(4)', 'token' => '^[a-z0-9]{4,30}$', - 'permissions' => '^(publishing-permissions|permissions)$', ], ], [ 'name' => 'Room#setAllAttendeesPermissions', - 'url' => '/api/{apiVersion}/room/{token}/attendees/{permissions}/all', + 'url' => '/api/{apiVersion}/room/{token}/attendees/permissions/all', 'verb' => 'PUT', 'requirements' => [ 'apiVersion' => 'v(4)', 'token' => '^[a-z0-9]{4,30}$', - 'permissions' => '^(publishing-permissions|permissions)$', ], ], [ diff --git a/docs/constants.md b/docs/constants.md index da857907a..65110a027 100644 --- a/docs/constants.md +++ b/docs/constants.md @@ -57,7 +57,7 @@ title: Constants * `guests` - Guest without a login * `emails` - A guest invited by email address -### Attendee publishing permissions +### Attendee permissions * `0` None * `1` Audio * `2` Video diff --git a/docs/conversation.md b/docs/conversation.md index 237f93ad2..e15edf910 100644 --- a/docs/conversation.md +++ b/docs/conversation.md @@ -43,7 +43,7 @@ `attendeePin` | string | v3 | | Unique dial-in authentication code for this user, when the conversation has SIP enabled (see `sipEnabled` attribute) `actorType` | string | v3 | | Currently known `users|guests|emails|groups|circles` `actorId` | string | v3 | | The unique identifier for the given actor type - `publishingPermissions` | int | v4 | | Publishing permissions for the current participant (see [constants list](constants.md#attendee-publishing-permissions)) + `permissions` | int | v4 | | Publishing permissions for the current participant (see [constants list](constants.md#attendee-permissions)) `participantInCall` | bool | v1 | v2 | **Removed:** use `participantFlags` instead `participantFlags` | int | v1 | | "In call" flags of the user's session making the request (only available with `in-call-flags` capability) `readOnly` | int | v1 | | Read-only state for the current user (only available with `read-only-rooms` capability) diff --git a/docs/participant.md b/docs/participant.md index 1ec8af4f1..4126bd6e0 100644 --- a/docs/participant.md +++ b/docs/participant.md @@ -34,7 +34,7 @@ `participantType` | int | v1 | | Permissions level of the participant (see [constants list](constants.md#participant-types)) `lastPing` | int | v1 | | Timestamp of the last ping of the user (should be used for sorting) `inCall` | int | v1 | | Call flags the user joined with (see [constants list](constants.md#participant-in-call-flag)) - `publishingPermissions` | int | v4 | | Publishing permissions for the participant (see [constants list](constants.md#attendee-publishing-permissions)) + `permissions` | int | v4 | | Publishing permissions for the participant (see [constants list](constants.md#attendee-permissions)) `sessionId` | string | v1 | v4 | `'0'` if not connected, otherwise a 512 character long string `sessionIds` | array | v4 | | array of session ids, each are 512 character long strings, or empty if no session `status` | string | v2 | | Optional: Only available with `includeStatus=true`, for users with a set status and when there are less than 100 participants in the conversation diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 026ec495b..535b0e33d 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -405,7 +405,7 @@ class RoomController extends AEnvironmentAwareController { 'actorType' => '', 'actorId' => '', 'attendeeId' => 0, - 'publishingPermissions' => Attendee::PERMISSIONS_NONE, + 'permissions' => Attendee::PERMISSIONS_NONE, 'canEnableSIP' => false, 'attendeePin' => '', 'description' => '', @@ -471,7 +471,7 @@ class RoomController extends AEnvironmentAwareController { 'actorType' => $attendee->getActorType(), 'actorId' => $attendee->getActorId(), 'attendeeId' => $attendee->getId(), - 'publishingPermissions' => $attendee->getPublishingPermissions(), + 'permissions' => $currentParticipant->getPermissions(), 'description' => $room->getDescription(), 'listable' => $room->getListable(), ]); @@ -520,7 +520,7 @@ class RoomController extends AEnvironmentAwareController { if ($room->getLobbyState() === Webinary::LOBBY_NON_MODERATORS && !$currentParticipant->hasModeratorPermissions() && - !($currentParticipant->getAttendee()->getPublishingPermissions() & Attendee::PERMISSIONS_LOBBY_IGNORE)) { + !($currentParticipant->getPermissions() & Attendee::PERMISSIONS_LOBBY_IGNORE)) { // No participants and chat messages for users in the lobby. $roomData['hasCall'] = false; return $roomData; @@ -955,7 +955,7 @@ class RoomController extends AEnvironmentAwareController { 'actorId' => $participant->getAttendee()->getActorId(), 'actorType' => $participant->getAttendee()->getActorType(), 'displayName' => $participant->getAttendee()->getActorId(), - 'publishingPermissions' => $participant->getAttendee()->getPublishingPermissions(), + 'permissions' => $participant->getPermissions(), 'attendeePin' => '', ]; if ($this->talkConfig->isSIPConfigured() diff --git a/lib/Controller/SignalingController.php b/lib/Controller/SignalingController.php index b06a45405..be820a853 100644 --- a/lib/Controller/SignalingController.php +++ b/lib/Controller/SignalingController.php @@ -404,7 +404,7 @@ class SignalingController extends OCSController { 'lastPing' => $session->getLastPing(), 'sessionId' => $session->getSessionId(), 'inCall' => $session->getInCall(), - 'publishingPermissions' => $participant->getAttendee()->getPublishingPermissions(), + 'permissions' => $participant->getPermissions(), ]; } @@ -687,10 +687,11 @@ class SignalingController extends OCSController { 'app' => 'spreed-hpb', ]); - if ($participant->getAttendee()->getPublishingPermissions() & (Attendee::PERMISSIONS_PUBLISH_AUDIO | Attendee::PERMISSIONS_PUBLISH_VIDEO)) { + // TODO split into two permissions? + if ($participant->getPermissions() & (Attendee::PERMISSIONS_PUBLISH_AUDIO | Attendee::PERMISSIONS_PUBLISH_VIDEO)) { $permissions[] = 'publish-media'; } - if ($participant->getAttendee()->getPublishingPermissions() & Attendee::PERMISSIONS_PUBLISH_SCREEN) { + if ($participant->getPermissions() & Attendee::PERMISSIONS_PUBLISH_SCREEN) { $permissions[] = 'publish-screen'; } if ($participant->hasModeratorPermissions(false)) { diff --git a/lib/Middleware/InjectionMiddleware.php b/lib/Middleware/InjectionMiddleware.php index 59737ff41..b4b074003 100644 --- a/lib/Middleware/InjectionMiddleware.php +++ b/lib/Middleware/InjectionMiddleware.php @@ -202,7 +202,7 @@ class InjectionMiddleware extends Middleware { $participant = $controller->getParticipant(); if ($participant instanceof Participant && - $participant->getAttendee()->getPublishingPermissions() & Attendee::PERMISSIONS_LOBBY_IGNORE) { + $participant->getPermissions() & Attendee::PERMISSIONS_LOBBY_IGNORE) { return; } diff --git a/lib/Migration/Version12000Date20210528100404.php b/lib/Migration/Version12000Date20210528100404.php index b5e324805..d78b366ff 100644 --- a/lib/Migration/Version12000Date20210528100404.php +++ b/lib/Migration/Version12000Date20210528100404.php @@ -40,17 +40,18 @@ class Version12000Date20210528100404 extends SimpleMigrationStep { * @return null|ISchemaWrapper */ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { - /** @var ISchemaWrapper $schema */ - $schema = $schemaClosure(); - - $table = $schema->getTable('talk_attendees'); - if (!$table->hasColumn('publishing_permissions')) { - $table->addColumn('publishing_permissions', Types::INTEGER, [ - 'default' => 7, // FIXME - ]); - - return $schema; - } + // Obsoleted by Version13000Date20210921142733 +// /** @var ISchemaWrapper $schema */ +// $schema = $schemaClosure(); +// +// $table = $schema->getTable('talk_attendees'); +// if (!$table->hasColumn('publishing_permissions')) { +// $table->addColumn('publishing_permissions', Types::INTEGER, [ +// 'default' => 7, +// ]); +// +// return $schema; +// } return null; } diff --git a/lib/Migration/Version13000Date20210921142733.php b/lib/Migration/Version13000Date20210921142733.php new file mode 100644 index 000000000..96e6ba3e6 --- /dev/null +++ b/lib/Migration/Version13000Date20210921142733.php @@ -0,0 +1,79 @@ +<?php + +declare(strict_types=1); +/** + * @copyright Copyright (c) 2021, Joas Schilling <coding@schilljs.com> + * + * @author Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCA\Talk\Migration; + +use Closure; +use Doctrine\DBAL\Types\Types; +use OCP\DB\ISchemaWrapper; +use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; + +class Version13000Date20210921142733 extends SimpleMigrationStep { + /** + * @param IOutput $output + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` + * @param array $options + * @return null|ISchemaWrapper + */ + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { + /** @var ISchemaWrapper $schema */ + $schema = $schemaClosure(); + + $table = $schema->getTable('talk_attendees'); + if ($table->hasColumn('publishing_permissions')) { + $table->dropColumn('publishing_permissions'); + } + + if (!$table->hasColumn('permissions')) { + $table->addColumn('permissions', Types::INTEGER, [ + 'default' => 0, + ]); + } + + $table = $schema->getTable('talk_rooms'); + if (!$table->hasColumn('default_permissions')) { + $table->addColumn('default_permissions', Types::INTEGER, [ + 'default' => 0, + ]); + } + if (!$table->hasColumn('call_permissions')) { + $table->addColumn('call_permissions', Types::INTEGER, [ + 'default' => 0, + ]); + } + + return $schema; + } + + /** + * @param IOutput $output + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` + * @param array $options + */ + public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { + // FIXME set default_permissions based on appconfig "start_calls" + } +} diff --git a/lib/Model/Attendee.php b/lib/Model/Attendee.php index a6c1bcd06..d83345519 100644 --- a/lib/Model/Attendee.php +++ b/lib/Model/Attendee.php @@ -51,8 +51,9 @@ use OCP\AppFramework\Db\Entity; * @method int getLastMentionDirect() * @method void setReadPrivacy(int $readPrivacy) * @method int getReadPrivacy() - * @method void setPublishingPermissions(int $publishingPermissions) - * @method int getPublishingPermissions() + * @method void setPermissions(int $permissions) + * @internal + * @method int getPermissions() * @method void setAccessToken(string $accessToken) * @method null|string getAccessToken() * @method void setRemoteId(string $remoteId) @@ -117,7 +118,7 @@ class Attendee extends Entity { protected $readPrivacy; /** @var int */ - protected $publishingPermissions; + protected $permissions; /** @var string */ protected $accessToken; @@ -139,7 +140,7 @@ class Attendee extends Entity { $this->addType('lastMentionMessage', 'int'); $this->addType('lastMentionDirect', 'int'); $this->addType('readPrivacy', 'int'); - $this->addType('publishingPermissions', 'int'); + $this->addType('permissions', 'int'); $this->addType('accessToken', 'string'); $this->addType('remote_id', 'string'); } @@ -167,7 +168,7 @@ class Attendee extends Entity { 'last_mention_message' => $this->getLastMentionMessage(), 'last_mention_direct' => $this->getLastMentionDirect(), 'read_privacy' => $this->getReadPrivacy(), - 'publishing_permissions' => $this->getPublishingPermissions(), + 'permissions' => $this->getPermissions(), 'access_token' => $this->getAccessToken(), 'remote_id' => $this->getRemoteId(), ]; diff --git a/lib/Model/AttendeeMapper.php b/lib/Model/AttendeeMapper.php index bd8551f46..174ca2d6e 100644 --- a/lib/Model/AttendeeMapper.php +++ b/lib/Model/AttendeeMapper.php @@ -198,7 +198,7 @@ class AttendeeMapper extends QBMapper { return (int) $query->execute(); } - public function modifyPublishingPermissions(int $roomId, string $mode, int $newState, bool $includeModerators): void { + public function modifyPermissions(int $roomId, string $mode, int $newState, bool $includeModerators): void { $query = $this->db->getQueryBuilder(); $query->update($this->getTableName()) ->where($query->expr()->eq('room_id', $query->createNamedParameter($roomId, IQueryBuilder::PARAM_INT))) @@ -216,7 +216,7 @@ class AttendeeMapper extends QBMapper { } if ($mode === Participant::PERMISSIONS_MODIFY_SET) { - $query->set('publishing_permissions', $query->createNamedParameter($newState, IQueryBuilder::PARAM_INT)); + $query->set('permissions', $query->createNamedParameter($newState, IQueryBuilder::PARAM_INT)); $query->executeStatement(); } else { foreach ([ @@ -229,53 +229,53 @@ class AttendeeMapper extends QBMapper { ] as $permission) { if ($permission & $newState) { if ($mode === Participant::PERMISSIONS_MODIFY_ADD) { - $this->addSinglePublishingPermission($query, $permission); + $this->addSinglePermission($query, $permission); } elseif ($mode === Participant::PERMISSIONS_MODIFY_REMOVE) { - $this->removeSinglePublishingPermission($query, $permission); + $this->removeSinglePermission($query, $permission); } } } } } - protected function addSinglePublishingPermission(IQueryBuilder $query, int $publishingPermission): void { - $query->set('publishing_permissions', $query->func()->add( - 'publishing_permissions', - $query->createNamedParameter($publishingPermission, IQueryBuilder::PARAM_INT) + protected function addSinglePermission(IQueryBuilder $query, int $permission): void { + $query->set('permissions', $query->func()->add( + 'permissions', + $query->createNamedParameter($permission, IQueryBuilder::PARAM_INT) )); $query->andWhere( $query->expr()->neq( $query->expr()->castColumn( $query->expr()->bitwiseAnd( - 'publishing_permissions', - $publishingPermission + 'permissions', + $permission ), IQueryBuilder::PARAM_INT ), - $query->createNamedParameter($publishingPermission, IQueryBuilder::PARAM_INT) + $query->createNamedParameter($permission, IQueryBuilder::PARAM_INT) ) ); $query->executeStatement(); } - protected function removeSinglePublishingPermission(IQueryBuilder $query, int $publishingPermission): void { - $query->set('publishing_permissions', $query->func()->subtract( - 'publishing_permissions', - $query->createNamedParameter($publishingPermission, IQueryBuilder::PARAM_INT) + protected function removeSinglePermission(IQueryBuilder $query, int $permission): void { + $query->set('permissions', $query->func()->subtract( + 'permissions', + $query->createNamedParameter($permission, IQueryBuilder::PARAM_INT) )); $query->andWhere( $query->expr()->eq( $query->expr()->castColumn( $query->expr()->bitwiseAnd( - 'publishing_permissions', - $publishingPermission + 'permissions', + $permission ), - IQueryBuilder::PARAM_INT + IQueryBuilder::PARAM_INT ), - $query->createNamedParameter($publishingPermission, IQueryBuilder::PARAM_INT) + $query->createNamedParameter($permission, IQueryBuilder::PARAM_INT) ) ); @@ -298,7 +298,7 @@ class AttendeeMapper extends QBMapper { 'last_mention_message' => (int) $row['last_mention_message'], 'last_mention_direct' => (int) $row['last_mention_direct'], 'read_privacy' => (int) $row['read_privacy'], - 'publishing_permissions' => (int) $row['publishing_permissions'], + 'permissions' => (int) $row['permissions'], 'access_token' => (string) $row['access_token'], 'remote_id' => (string) $row['remote_id'], ]); diff --git a/lib/Participant.php b/lib/Participant.php index b115709df..92a4866d0 100644 --- a/lib/Participant.php +++ b/lib/Participant.php @@ -99,6 +99,10 @@ class Participant { public function canStartCall(IConfig $config): bool { $defaultStartCall = (int) $config->getAppValue('spreed', 'start_calls', Room::START_CALL_EVERYONE); + if (!($this->getPermissions() & Attendee::PERMISSIONS_CALL_START)) { + return false; + } + if ($defaultStartCall === Room::START_CALL_EVERYONE) { return true; } @@ -113,4 +117,48 @@ class Participant { return false; } + + public function getPermissions(): int { + $permissions = $this->getPermissionsFromFallbackChain(); + + if ($this->hasModeratorPermissions()) { + // Moderators can always do everything + $permissions |= + Attendee::PERMISSIONS_CALL_START | + Attendee::PERMISSIONS_CALL_JOIN | + Attendee::PERMISSIONS_LOBBY_IGNORE | + Attendee::PERMISSIONS_PUBLISH_AUDIO | + Attendee::PERMISSIONS_PUBLISH_VIDEO | + Attendee::PERMISSIONS_PUBLISH_SCREEN + ; + } + + return $permissions; + } + + protected function getPermissionsFromFallbackChain(): int { + if ($this->getAttendee()->getPermissions()) { + return $this->getAttendee()->getPermissions(); + } + + if ($this->room->getCallPermissions()) { + // The currently ongoing call is in a special mode + return $this->room->getCallPermissions(); + } + + if ($this->room->getDefaultPermissions()) { + // The conversation has some permissions set + return $this->room->getDefaultPermissions(); + } + + // Falling back to an unrestricted set of permissions, only ignoring the lobby is off + return + Attendee::PERMISSIONS_CALL_START | + Attendee::PERMISSIONS_CALL_JOIN | + // Attendee::PERMISSIONS_LOBBY_IGNORE | + Attendee::PERMISSIONS_PUBLISH_AUDIO | + Attendee::PERMISSIONS_PUBLISH_VIDEO | + Attendee::PERMISSIONS_PUBLISH_SCREEN + ; + } } diff --git a/lib/Room.php b/lib/Room.php index 035072261..c6a3f1589 100644 --- a/lib/Room.php +++ b/lib/Room.php @@ -120,8 +120,8 @@ class Room { public const EVENT_AFTER_USERS_ADD = self::class . '::postAddUsers'; public const EVENT_BEFORE_PARTICIPANT_TYPE_SET = self::class . '::preSetParticipantType'; public const EVENT_AFTER_PARTICIPANT_TYPE_SET = self::class . '::postSetParticipantType'; - public const EVENT_BEFORE_PARTICIPANT_PUBLISHING_PERMISSIONS_SET = self::class . '::preSetParticipantPublishingPermissions'; - public const EVENT_AFTER_PARTICIPANT_PUBLISHING_PERMISSIONS_SET = self::class . '::postSetParticipantPublishingPermissions'; + public const EVENT_BEFORE_PARTICIPANT_PERMISSIONS_SET = self::class . '::preSetParticipantPermissions'; + public const EVENT_AFTER_PARTICIPANT_PERMISSIONS_SET = self::class . '::postSetParticipantPermissions'; public const EVENT_BEFORE_USER_REMOVE = self::class . '::preRemoveUser'; public const EVENT_AFTER_USER_REMOVE = self::class . '::postRemoveUser'; public const EVENT_BEFORE_PARTICIPANT_REMOVE = self::class . '::preRemoveBySession'; diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index 001aed0b7..04a6be2cf 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -147,26 +147,26 @@ class ParticipantService { return; } - $oldState = $attendee->getPublishingPermissions(); + $oldState = $participant->getPermissions(); - $event = new ModifyParticipantEvent($room, $participant, 'publishingPermissions', $newState, $oldState); - $this->dispatcher->dispatch(Room::EVENT_BEFORE_PARTICIPANT_PUBLISHING_PERMISSIONS_SET, $event); + $event = new ModifyParticipantEvent($room, $participant, 'permissions', $newState, $oldState); + $this->dispatcher->dispatch(Room::EVENT_BEFORE_PARTICIPANT_PERMISSIONS_SET, $event); - $attendee->setPublishingPermissions($newState); + $attendee->setPermissions($newState); $this->attendeeMapper->update($attendee); - $this->dispatcher->dispatch(Room::EVENT_AFTER_PARTICIPANT_PUBLISHING_PERMISSIONS_SET, $event); + $this->dispatcher->dispatch(Room::EVENT_AFTER_PARTICIPANT_PERMISSIONS_SET, $event); } public function updateAllPermissions(Room $room, string $mode, int $newState, bool $includeModerators): void { // FIXME Add events after checking what should be sent to the HPB - // $event = new ModifyParticipantEvent($room, $participant, 'publishingPermissions', $newState, $oldState); - // $this->dispatcher->dispatch(Room::EVENT_BEFORE_PARTICIPANT_PUBLISHING_PERMISSIONS_SET, $event); + // $event = new ModifyParticipantEvent($room, $participant, 'permissions', $newState, $oldState); + // $this->dispatcher->dispatch(Room::EVENT_BEFORE_PARTICIPANT_PERMISSIONS_SET, $event); - $this->attendeeMapper->modifyPublishingPermissions($room->getId(), $mode, $newState, $includeModerators); + $this->attendeeMapper->modifyPermissions($room->getId(), $mode, $newState, $includeModerators); // FIXME Add events after checking what should be sent to the HPB - // $this->dispatcher->dispatch(Room::EVENT_AFTER_PARTICIPANT_PUBLISHING_PERMISSIONS_SET, $event); + // $this->dispatcher->dispatch(Room::EVENT_AFTER_PARTICIPANT_PERMISSIONS_SET, $event); } public function updateLastReadMessage(Participant $participant, int $lastReadMessage): void { @@ -871,11 +871,11 @@ class ParticipantService { return; } - $publishingPermissions = $participant->getAttendee()->getPublishingPermissions(); - if (!($publishingPermissions & Attendee::PERMISSIONS_PUBLISH_AUDIO)) { + $permissions = $participant->getPermissions(); + if (!($permissions & Attendee::PERMISSIONS_PUBLISH_AUDIO)) { $flags &= ~Participant::FLAG_WITH_AUDIO; } - if (!($publishingPermissions & Attendee::PERMISSIONS_PUBLISH_VIDEO)) { + if (!($permissions & Attendee::PERMISSIONS_PUBLISH_VIDEO)) { $flags &= ~Participant::FLAG_WITH_VIDEO; } @@ -916,11 +916,11 @@ class ParticipantService { throw new \InvalidArgumentException('Invalid flags'); } - $publishingPermissions = $participant->getAttendee()->getPublishingPermissions(); - if (!($publishingPermissions & Attendee::PERMISSIONS_PUBLISH_AUDIO)) { + $permissions = $participant->getPermissions(); + if (!($permissions & Attendee::PERMISSIONS_PUBLISH_AUDIO)) { $flags &= ~Participant::FLAG_WITH_AUDIO; } - if (!($publishingPermissions & Attendee::PERMISSIONS_PUBLISH_VIDEO)) { + if (!($permissions & Attendee::PERMISSIONS_PUBLISH_VIDEO)) { $flags &= ~Participant::FLAG_WITH_VIDEO; } diff --git a/lib/Signaling/BackendNotifier.php b/lib/Signaling/BackendNotifier.php index 2f874b5cb..d9576cb5d 100644 --- a/lib/Signaling/BackendNotifier.php +++ b/lib/Signaling/BackendNotifier.php @@ -296,7 +296,7 @@ class BackendNotifier { 'lastPing' => 0, 'sessionId' => '0', 'participantType' => $attendee->getParticipantType(), - 'publishingPermissions' => Attendee::PERMISSIONS_NONE, + 'participantPermissions' => Attendee::PERMISSIONS_NONE, ]; if ($attendee->getActorType() === Attendee::ACTOR_USERS) { $data['userId'] = $attendee->getActorId(); @@ -307,15 +307,16 @@ class BackendNotifier { $data['inCall'] = $session->getInCall(); $data['lastPing'] = $session->getLastPing(); $data['sessionId'] = $session->getSessionId(); - $data['publishingPermissions'] = $attendee->getPublishingPermissions(); + $data['participantPermissions'] = $participant->getPermissions(); $users[] = $data; if (\in_array($session->getSessionId(), $sessionIds, true)) { $data['permissions'] = []; - if ($attendee->getPublishingPermissions() & (Attendee::PERMISSIONS_PUBLISH_AUDIO | Attendee::PERMISSIONS_PUBLISH_VIDEO)) { + // TODO split into two permissions? + if ($participant->getPermissions() & (Attendee::PERMISSIONS_PUBLISH_AUDIO | Attendee::PERMISSIONS_PUBLISH_VIDEO)) { $data['permissions'][] = 'publish-media'; } - if ($attendee->getPublishingPermissions() & Attendee::PERMISSIONS_PUBLISH_SCREEN) { + if ($participant->getPermissions() & Attendee::PERMISSIONS_PUBLISH_SCREEN) { $data['permissions'][] = 'publish-screen'; } if ($attendee->getParticipantType() === Participant::OWNER || diff --git a/src/components/CallView/shared/LocalMediaControls.vue b/src/components/CallView/shared/LocalMediaControls.vue index ca2dbe99e..e878d55f3 100644 --- a/src/components/CallView/shared/LocalMediaControls.vue +++ b/src/components/CallView/shared/LocalMediaControls.vue @@ -301,15 +301,15 @@ export default { }, isAudioAllowed() { - return this.conversation.publishingPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO + return this.conversation.permissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO }, isVideoAllowed() { - return this.conversation.publishingPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO + return this.conversation.permissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO }, isScreensharingAllowed() { - return this.conversation.publishingPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_SCREEN + return this.conversation.permissions & PARTICIPANT.PERMISSIONS.PUBLISH_SCREEN }, audioButtonClass() { diff --git a/src/components/TopBar/CallButton.vue b/src/components/TopBar/CallButton.vue index a6045e138..1a02569a6 100644 --- a/src/components/TopBar/CallButton.vue +++ b/src/components/TopBar/CallButton.vue @@ -187,10 +187,10 @@ export default { async joinCall() { let flags = PARTICIPANT.CALL_FLAG.IN_CALL - if (this.conversation.publishingPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO) { + if (this.conversation.permissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO) { flags |= PARTICIPANT.CALL_FLAG.WITH_AUDIO } - if (this.conversation.publishingPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO) { + if (this.conversation.permissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO) { flags |= PARTICIPANT.CALL_FLAG.WITH_VIDEO } diff --git a/src/mixins/isInLobby.js b/src/mixins/isInLobby.js index d7cb4838b..189f0f881 100644 --- a/src/mixins/isInLobby.js +++ b/src/mixins/isInLobby.js @@ -42,7 +42,7 @@ export default { return this.conversation && this.conversation.lobbyState === WEBINAR.LOBBY.NON_MODERATORS && !this.isModerator - && (this.conversation.publishingPermissions & PARTICIPANT.PERMISSIONS.LOBBY_IGNORE) === 0 + && (this.conversation.permissions & PARTICIPANT.PERMISSIONS.LOBBY_IGNORE) === 0 }, }, diff --git a/src/utils/webrtc/webrtc.js b/src/utils/webrtc/webrtc.js index 9d2635255..14ea740b5 100644 --- a/src/utils/webrtc/webrtc.js +++ b/src/utils/webrtc/webrtc.js @@ -914,7 +914,7 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local }) } - const reconnectOnPublishingPermissionsChange = (users) => { + const reconnectOnPermissionsChange = (users) => { const currentParticipant = users.find(user => { const sessionId = user.sessionId || user.sessionid return sessionId === signaling.getSessionId() @@ -928,25 +928,25 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local return } - if (currentParticipant.publishingPermissions === undefined) { + if (currentParticipant.participantPermissions === undefined) { return } - if ((currentParticipant.publishingPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO) - && (currentParticipant.publishingPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO) + if ((currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO) + && (currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO) && webrtc.webrtc.isLocalMediaActive()) { return } - if (!(currentParticipant.publishingPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO) - && !(currentParticipant.publishingPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO) + if (!(currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO) + && !(currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO) && !webrtc.webrtc.isLocalMediaActive()) { return } // FIXME handle case where only one of the permissions is given - if (!(currentParticipant.publishingPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO) - && !(currentParticipant.publishingPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO)) { + if (!(currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO) + && !(currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO)) { startedWithMedia = undefined webrtc.stopLocalVideo() @@ -999,10 +999,10 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local } signaling.on('usersInRoom', function(users) { - reconnectOnPublishingPermissionsChange(users) + reconnectOnPermissionsChange(users) }) signaling.on('usersChanged', function(users) { - reconnectOnPublishingPermissionsChange(users) + reconnectOnPermissionsChange(users) }) webrtc.on('createdPeer', function(peer) { diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index fc1519365..05e8e84f3 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -398,8 +398,8 @@ class FeatureContext implements Context, SnippetAcceptingContext { if (isset($expectedKeys['attendeePin'])) { $data['attendeePin'] = $attendee['attendeePin'] ? '**PIN**' : ''; } - if (isset($expectedKeys['publishingPermissions'])) { - $data['publishingPermissions'] = (string) $attendee['publishingPermissions']; + if (isset($expectedKeys['permissions'])) { + $data['permissions'] = (string) $attendee['permissions']; } if (!isset(self::$userToAttendeeId[$attendee['actorType']])) { @@ -417,8 +417,8 @@ class FeatureContext implements Context, SnippetAcceptingContext { if (isset($attendee['participantType'])) { $attendee['participantType'] = (string)$this->mapParticipantTypeTestInput($attendee['participantType']); } - if (isset($attendee['publishingPermissions'])) { - $attendee['publishingPermissions'] = (string)$this->mapPublishingPermissionsTestInput($attendee['publishingPermissions']); + if (isset($attendee['permissions'])) { + $attendee['permissions'] = (string)$this->mapPermissionsTestInput($attendee['permissions']); } return $attendee; }, $formData->getHash()); @@ -480,12 +480,13 @@ class FeatureContext implements Context, SnippetAcceptingContext { Assert::fail('Invalid test input value for participant type'); } - private function mapPublishingPermissionsTestInput($publishingPermissions) { - if (is_numeric($publishingPermissions)) { - return $publishingPermissions; + // FIXME this function needs rewriting + private function mapPermissionsTestInput($permissions) { + if (is_numeric($permissions)) { + return $permissions; } - switch ($publishingPermissions) { + switch ($permissions) { case 'NONE': return 0; case 'AUDIO': return 1; case 'VIDEO': return 2; @@ -493,7 +494,7 @@ class FeatureContext implements Context, SnippetAcceptingContext { case 'ALL': return 7; } - Assert::fail('Invalid test input value for publishing permissions'); + Assert::fail('Invalid test input value for permissions'); } /** @@ -1087,12 +1088,13 @@ class FeatureContext implements Context, SnippetAcceptingContext { * @When /^user "([^"]*)" sets publishing permissions for "([^"]*)" in room "([^"]*)" to "([^"]*)" with (\d+) \((v4)\)$/ * * @param string $user + * @param string $participant * @param string $identifier - * @param string $publishingPermissionsString + * @param string $permissionsString * @param int $statusCode * @param string $apiVersion */ - public function userSetsPublishingPermissionsForInRoomTo(string $user, string $participant, string $identifier, string $publishingPermissionsString, int $statusCode, string $apiVersion): void { + public function userSetsPermissionsForInRoomTo(string $user, string $participant, string $identifier, string $permissionsString, int $statusCode, string $apiVersion): void { if ($participant === 'stranger') { $attendeeId = 123456789; } elseif (strpos($participant, 'guest') === 0) { @@ -1102,23 +1104,23 @@ class FeatureContext implements Context, SnippetAcceptingContext { $attendeeId = $this->getAttendeeId('users', $participant, $identifier, $statusCode === 200 ? $user : null); } - if ($publishingPermissionsString === 'NONE') { - $publishingPermissions = 0; - } elseif ($publishingPermissionsString === 'AUDIO') { - $publishingPermissions = 1; - } elseif ($publishingPermissionsString === 'VIDEO') { - $publishingPermissions = 2; - } elseif ($publishingPermissionsString === 'SCREENSHARING') { - $publishingPermissions = 4; - } elseif ($publishingPermissionsString === 'ALL') { - $publishingPermissions = 7; + if ($permissionsString === 'NONE') { + $permissions = 0; + } elseif ($permissionsString === 'AUDIO') { + $permissions = 1; + } elseif ($permissionsString === 'VIDEO') { + $permissions = 2; + } elseif ($permissionsString === 'SCREENSHARING') { + $permissions = 4; + } elseif ($permissionsString === 'ALL') { + $permissions = 7; } else { - Assert::fail('Invalid publishing permissions'); + Assert::fail('Invalid permissions'); } $requestParameters = [ ['attendeeId', $attendeeId], - ['state', $publishingPermissions], + ['state', $permissions], ]; $this->setCurrentUser($user); diff --git a/tests/integration/features/conversation-2/set-publishing-permissions.feature b/tests/integration/features/conversation-2/set-publishing-permissions.feature index b75430684..eabe85459 100644 --- a/tests/integration/features/conversation-2/set-publishing-permissions.feature +++ b/tests/integration/features/conversation-2/set-publishing-permissions.feature @@ -17,11 +17,11 @@ Feature: set-publishing-permissions And user "moderator" sets publishing permissions for "owner" in room "one-to-one room" to "NONE" with 400 (v4) And user "moderator" sets publishing permissions for "moderator" in room "one-to-one room" to "NONE" with 400 (v4) Then user "owner" sees the following attendees in room "one-to-one room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | ALL | | users | moderator | ALL | And user "moderator" sees the following attendees in room "one-to-one room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | ALL | | users | moderator | ALL | @@ -39,17 +39,17 @@ Feature: set-publishing-permissions And user "owner" sets publishing permissions for "moderator" in room "group room" to "NONE" with 200 (v4) And user "owner" sets publishing permissions for "invited user" in room "group room" to "NONE" with 200 (v4) Then user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | And user "moderator" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | And user "invited user" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -66,17 +66,17 @@ Feature: set-publishing-permissions And user "moderator" sets publishing permissions for "moderator" in room "group room" to "NONE" with 200 (v4) And user "moderator" sets publishing permissions for "invited user" in room "group room" to "NONE" with 200 (v4) Then user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | And user "moderator" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | And user "invited user" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -100,17 +100,17 @@ Feature: set-publishing-permissions And user "guest not joined" sets publishing permissions for "moderator" in room "group room" to "NONE" with 404 (v4) And user "guest not joined" sets publishing permissions for "invited user" in room "group room" to "NONE" with 404 (v4) Then user "owner" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | ALL | | users | moderator | ALL | | users | invited user | ALL | And user "moderator" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | ALL | | users | moderator | ALL | | users | invited user | ALL | And user "invited user" sees the following attendees in room "group room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | ALL | | users | moderator | ALL | | users | invited user | ALL | @@ -136,7 +136,7 @@ Feature: set-publishing-permissions And user "owner" sets publishing permissions for "guest moderator" in room "public room" to "NONE" with 200 (v4) And user "owner" sets publishing permissions for "guest" in room "public room" to "NONE" with 200 (v4) Then user "owner" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -144,7 +144,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "moderator" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -152,7 +152,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "invited user" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -160,7 +160,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "not invited but joined user" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -168,7 +168,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "guest moderator" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -195,7 +195,7 @@ Feature: set-publishing-permissions And user "moderator" sets publishing permissions for "guest moderator" in room "public room" to "NONE" with 200 (v4) And user "moderator" sets publishing permissions for "guest" in room "public room" to "NONE" with 200 (v4) Then user "owner" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -203,7 +203,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "moderator" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -211,7 +211,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "invited user" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -219,7 +219,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "not invited but joined user" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -227,7 +227,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "guest moderator" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -256,7 +256,7 @@ Feature: set-publishing-permissions And user "guest moderator" sets publishing permissions for "guest moderator" in room "public room" to "NONE" with 200 (v4) And user "guest moderator" sets publishing permissions for "guest" in room "public room" to "NONE" with 200 (v4) Then user "owner" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -264,7 +264,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "moderator" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -272,7 +272,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "invited user" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -280,7 +280,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "not invited but joined user" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -288,7 +288,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | NONE | | guests | "guest" | NONE | And user "guest moderator" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | NONE | | users | moderator | NONE | | users | invited user | NONE | @@ -341,7 +341,7 @@ Feature: set-publishing-permissions And user "guest not joined" sets publishing permissions for "guest moderator" in room "public room" to "NONE" with 404 (v4) And user "guest not joined" sets publishing permissions for "guest" in room "public room" to "NONE" with 404 (v4) Then user "owner" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | ALL | | users | moderator | ALL | | users | invited user | ALL | @@ -349,7 +349,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | ALL | | guests | "guest" | ALL | And user "moderator" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | ALL | | users | moderator | ALL | | users | invited user | ALL | @@ -357,7 +357,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | ALL | | guests | "guest" | ALL | And user "invited user" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | ALL | | users | moderator | ALL | | users | invited user | ALL | @@ -365,7 +365,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | ALL | | guests | "guest" | ALL | And user "not invited but joined user" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | ALL | | users | moderator | ALL | | users | invited user | ALL | @@ -373,7 +373,7 @@ Feature: set-publishing-permissions | guests | "guest moderator" | ALL | | guests | "guest" | ALL | And user "guest moderator" sees the following attendees in room "public room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner | ALL | | users | moderator | ALL | | users | invited user | ALL | @@ -407,12 +407,12 @@ Feature: set-publishing-permissions And user "guest" sets publishing permissions for "user with access to file" in room "file last share room" to "NONE" with 403 (v4) And user "guest" sets publishing permissions for "guest" in room "file last share room" to "NONE" with 403 (v4) Then user "owner of file" sees the following attendees in room "file last share room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner of file | ALL | | users | user with access to file | ALL | | guests | "guest" | ALL | And user "user with access to file" sees the following attendees in room "file last share room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner of file | ALL | | users | user with access to file | ALL | | guests | "guest" | ALL | @@ -434,6 +434,6 @@ Feature: set-publishing-permissions When user "owner of file" sets publishing permissions for "owner of file" in room "password request for last share room" to "NONE" with 200 (v4) And user "owner of file" sets publishing permissions for "guest" in room "password request for last share room" to "NONE" with 200 (v4) Then user "owner of file" sees the following attendees in room "password request for last share room" with 200 (v4) - | actorType | actorId | publishingPermissions | + | actorType | actorId | permissions | | users | owner of file | NONE | | guests | "guest" | NONE | diff --git a/tests/php/Controller/SignalingControllerTest.php b/tests/php/Controller/SignalingControllerTest.php index 2dc2dd126..4cbd89e49 100644 --- a/tests/php/Controller/SignalingControllerTest.php +++ b/tests/php/Controller/SignalingControllerTest.php @@ -668,7 +668,7 @@ class SignalingControllerTest extends \Test\TestCase { ], $result->getData()); } - public function dataBackendRoomUserPublicPublishingPermissions(): array { + public function dataBackendRoomUserPublicPermissions(): array { return [ [Attendee::PERMISSIONS_NONE, []], [Attendee::PERMISSIONS_PUBLISH_AUDIO, ['publish-media']], @@ -682,12 +682,12 @@ class SignalingControllerTest extends \Test\TestCase { } /** - * @dataProvider dataBackendRoomUserPublicPublishingPermissions + * @dataProvider dataBackendRoomUserPublicPermissions * - * @param int $publishingPermissions + * @param int $permissions * @param array $expectedBackendPermissions */ - public function testBackendRoomUserPublicPublishingPermissions(int $publishingPermissions, array $expectedBackendPermissions) { + public function testBackendRoomUserPublicPermissions(int $permissions, array $expectedBackendPermissions) { $roomToken = 'the-room'; $roomName = 'the-room-name'; $room = $this->createMock(Room::class); @@ -697,7 +697,7 @@ class SignalingControllerTest extends \Test\TestCase { ->willReturn($room); $attendee = Attendee::fromRow([ - 'publishing_permissions' => $publishingPermissions, + 'permissions' => $permissions, ]); $participant = $this->createMock(Participant::class); $participant->expects($this->any()) diff --git a/tests/php/Model/AttendeeMapperTest.php b/tests/php/Model/AttendeeMapperTest.php index dad2fea1b..2d3478eec 100644 --- a/tests/php/Model/AttendeeMapperTest.php +++ b/tests/php/Model/AttendeeMapperTest.php @@ -46,7 +46,7 @@ class AttendeeMapperTest extends TestCase { ); } - public function dataModifyPublishingPermissions(): array { + public function dataModifyPermissions(): array { return [ 0 => [ [ @@ -54,34 +54,34 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_CIRCLES, 'actor_id' => 'c1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_GROUPS, 'actor_id' => 'g1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], ], - Participant::PERMISSIONS_SET, + Participant::PERMISSIONS_MODIFY_SET, Participant::FLAG_IN_CALL, false, [ @@ -89,31 +89,31 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_CIRCLES, 'actor_id' => 'c1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_GROUPS, 'actor_id' => 'g1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_IN_CALL, ], ], ], @@ -123,34 +123,34 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_CIRCLES, 'actor_id' => 'c1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_GROUPS, 'actor_id' => 'g1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], ], - Participant::PERMISSIONS_SET, + Participant::PERMISSIONS_MODIFY_SET, Participant::FLAG_IN_CALL, true, [ @@ -158,31 +158,31 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_CIRCLES, 'actor_id' => 'c1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_GROUPS, 'actor_id' => 'g1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_IN_CALL, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_IN_CALL, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_IN_CALL, ], ], ], @@ -192,22 +192,22 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], ], - Participant::PERMISSIONS_SET, + Participant::PERMISSIONS_MODIFY_SET, Participant::FLAG_IN_CALL, false, [ @@ -215,19 +215,19 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_IN_CALL, ], ], ], @@ -237,22 +237,22 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], ], - Participant::PERMISSIONS_SET, + Participant::PERMISSIONS_MODIFY_SET, Participant::FLAG_IN_CALL, true, [ @@ -260,19 +260,19 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_IN_CALL, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_IN_CALL, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_IN_CALL, ], ], ], @@ -282,28 +282,28 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_VIDEO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO, + 'permissions' => Participant::FLAG_WITH_AUDIO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u2', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_IN_CALL, ], ], - Participant::PERMISSIONS_ADD, + Participant::PERMISSIONS_MODIFY_ADD, Participant::FLAG_IN_CALL, true, [ @@ -311,25 +311,25 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO + Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO + Participant::FLAG_IN_CALL, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_WITH_VIDEO + Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_WITH_VIDEO + Participant::FLAG_IN_CALL, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_IN_CALL, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u2', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_IN_CALL, ], ], ], @@ -339,34 +339,34 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO + Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO + Participant::FLAG_IN_CALL, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_WITH_VIDEO + Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_WITH_VIDEO + Participant::FLAG_IN_CALL, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_IN_CALL, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u2', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_IN_CALL, + 'permissions' => Participant::FLAG_IN_CALL, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u3', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], ], - Participant::PERMISSIONS_REMOVE, + Participant::PERMISSIONS_MODIFY_REMOVE, Participant::FLAG_IN_CALL, true, [ @@ -374,31 +374,31 @@ class AttendeeMapperTest extends TestCase { 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'publishing_permissions' => Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_VIDEO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u1', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO, + 'permissions' => Participant::FLAG_WITH_AUDIO, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u2', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_DISCONNECTED, + 'permissions' => Participant::FLAG_DISCONNECTED, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'u3', 'participant_type' => Participant::USER, - 'publishing_permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, + 'permissions' => Participant::FLAG_WITH_AUDIO + Participant::FLAG_WITH_VIDEO, ], ], ], @@ -406,14 +406,14 @@ class AttendeeMapperTest extends TestCase { } /** - * @dataProvider dataModifyPublishingPermissions + * @dataProvider dataModifyPermissions * @param array $attendees * @param string $mode * @param int $permission * @param bool $includeModerators * @param array $expected */ - public function testModifyPublishingPermissions(array $attendees, string $mode, int $permission, bool $includeModerators, array $expected): void { + public function testModifyPermissions(array $attendees, string $mode, int $permission, bool $includeModerators, array $expected): void { $roomId = 12345678; foreach ($attendees as $attendeeData) { @@ -428,19 +428,19 @@ class AttendeeMapperTest extends TestCase { $attendee->setActorType($attendeeData['actor_type']); $attendee->setActorId($attendeeData['actor_id']); $attendee->setParticipantType($attendeeData['participant_type']); - $attendee->setPublishingPermissions($attendeeData['publishing_permissions']); + $attendee->setPermissions($attendeeData['permissions']); $this->attendeeMapper->insert($attendee); } - $this->attendeeMapper->modifyPublishingPermissions($roomId, $mode, $permission, $includeModerators); + $this->attendeeMapper->modifyPermissions($roomId, $mode, $permission, $includeModerators); foreach ($expected as $attendeeData) { $attendee = $this->attendeeMapper->findByActor($roomId, $attendeeData['actor_type'], $attendeeData['actor_id']); $this->assertEquals( - $attendeeData['publishing_permissions'], - $attendee->getPublishingPermissions(), - 'Publishing permissions mismatch for ' . $attendeeData['actor_type'] . '#' . $attendeeData['actor_id'] + $attendeeData['permissions'], + $attendee->getPermissions(), + 'Permissions mismatch for ' . $attendeeData['actor_type'] . '#' . $attendeeData['actor_id'] ); $this->attendeeMapper->delete($attendee); } diff --git a/tests/php/Signaling/BackendNotifierTest.php b/tests/php/Signaling/BackendNotifierTest.php index 964535be5..0c7c4e811 100644 --- a/tests/php/Signaling/BackendNotifierTest.php +++ b/tests/php/Signaling/BackendNotifierTest.php @@ -666,7 +666,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $userSession, 'participantType' => Participant::MODERATOR, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, 'userId' => $this->userId, ], ], @@ -676,7 +676,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $userSession, 'participantType' => Participant::MODERATOR, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, 'userId' => $this->userId, ], ], @@ -701,7 +701,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $guestSession, 'participantType' => Participant::GUEST_MODERATOR, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, ], ], 'users' => [ @@ -710,7 +710,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $userSession, 'participantType' => Participant::MODERATOR, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, 'userId' => $this->userId, ], [ @@ -718,7 +718,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $guestSession, 'participantType' => Participant::GUEST_MODERATOR, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, ], ], ], @@ -745,7 +745,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $userSession, 'participantType' => Participant::MODERATOR, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, 'userId' => $this->userId, ], [ @@ -753,7 +753,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => 0, 'participantType' => Participant::MODERATOR, - 'publishingPermissions' => Attendee::PERMISSIONS_NONE, + 'permissions' => Attendee::PERMISSIONS_NONE, 'userId' => $notJoinedUserId, ], [ @@ -761,7 +761,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $guestSession, 'participantType' => Participant::GUEST_MODERATOR, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, ], ], ], @@ -780,7 +780,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $userSession, 'participantType' => Participant::USER, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, 'userId' => $this->userId, ], ], @@ -790,7 +790,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $userSession, 'participantType' => Participant::USER, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, 'userId' => $this->userId, ], [ @@ -798,7 +798,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => 0, 'participantType' => Participant::MODERATOR, - 'publishingPermissions' => Attendee::PERMISSIONS_NONE, + 'permissions' => Attendee::PERMISSIONS_NONE, 'userId' => $notJoinedUserId, ], [ @@ -806,7 +806,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $guestSession, 'participantType' => Participant::GUEST_MODERATOR, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, ], ], ], @@ -825,7 +825,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $guestSession, 'participantType' => Participant::GUEST, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, ], ], 'users' => [ @@ -834,7 +834,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $userSession, 'participantType' => Participant::USER, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, 'userId' => $this->userId, ], [ @@ -842,7 +842,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => 0, 'participantType' => Participant::MODERATOR, - 'publishingPermissions' => Attendee::PERMISSIONS_NONE, + 'permissions' => Attendee::PERMISSIONS_NONE, 'userId' => $notJoinedUserId, ], [ @@ -850,14 +850,14 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $guestSession, 'participantType' => Participant::GUEST, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, ], ], ], ]); $this->controller->clearRequests(); - $this->participantService->updatePublishingPermissions($room, $guestParticipant, Attendee::PERMISSIONS_NONE); + $this->participantService->updatePermissions($room, $guestParticipant, Attendee::PERMISSIONS_NONE); $this->assertMessageWasSent($room, [ 'type' => 'participants', @@ -869,7 +869,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $guestSession, 'participantType' => Participant::GUEST, - 'publishingPermissions' => Attendee::PERMISSIONS_NONE, + 'permissions' => Attendee::PERMISSIONS_NONE, ], ], 'users' => [ @@ -878,7 +878,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $userSession, 'participantType' => Participant::USER, - 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, + 'permissions' => Attendee::PUBLISHING_PERMISSIONS_ALL, 'userId' => $this->userId, ], [ @@ -886,7 +886,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => 0, 'participantType' => Participant::MODERATOR, - 'publishingPermissions' => Attendee::PERMISSIONS_NONE, + 'permissions' => Attendee::PERMISSIONS_NONE, 'userId' => $notJoinedUserId, ], [ @@ -894,7 +894,7 @@ class BackendNotifierTest extends \Test\TestCase { 'lastPing' => 0, 'sessionId' => $guestSession, 'participantType' => Participant::GUEST, - 'publishingPermissions' => Attendee::PERMISSIONS_NONE, + 'permissions' => Attendee::PERMISSIONS_NONE, ], ], ], |