Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ›ƒ feat(permissions): Contract part for conversation-permissions-v2 #13762

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,6 @@
* `download-call-participants` - Whether the endpoints for moderators to download the call participants is available
* `config => call => start-without-media` (local) - Boolean, whether media should be disabled when starting or joining a conversation
* `config => call => max-duration` - Integer, maximum call duration in seconds. Please note that this should only be used with system cron and with a reasonable high value, due to the expended duration until the background job ran.

## 21
* `conversation-permissions-v2` - The chat permission was split into individual permissions for writing a message, reacting to a message, viewing and sharing attachments, editing whiteboards. Additionally new permissions for moderating a call and seeing the participant list where introduced.
9 changes: 8 additions & 1 deletion docs/constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,14 @@
* `16` Can publish audio stream
* `32` Can publish video stream
* `64` Can publish screen sharing stream
* `128` Can post chat message, share items and do reactions
* `128` Can post chat message (Was split into 128, 256, 512, 1024 and 2048 with the `conversation-permissions-v2` capability)
* `256` Can react to chat messages (Only with the `conversation-permissions-v2` capability, otherwise check `128`)
* `512` Can see files shared into the chat (Only with the `conversation-permissions-v2` capability, otherwise check `128`)
* `1024` Can share files into the chat (Only with the `conversation-permissions-v2` capability, otherwise check `128`)
* `2048` Can share other items, including polls, location and more into the chat (Only with the `conversation-permissions-v2` capability, otherwise granted)
* `4096` Can edit whiteboards (Only with the `conversation-permissions-v2` capability, otherwise check `128`)
* `8192` Can see the participants list (Only with the `conversation-permissions-v2` capability, otherwise granted)
* `16384` Can moderate the call (but not other participants), e.g. starting and stopping the lobby, will survive setting conversation permissions for all other users (Only with the `conversation-permissions-v2` capability, otherwise not-granted)

### Attendee permission modifications
* `set` - Setting this permission set.
Expand Down
1 change: 1 addition & 0 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class Capabilities implements IPublicCapability {
'archived-conversations',
'talk-polls-drafts',
'download-call-participants',
'conversation-permissions-v2',
];

public const LOCAL_FEATURES = [
Expand Down
4 changes: 2 additions & 2 deletions lib/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ public function getDefaultPermissions(): int {
return min(Attendee::PERMISSIONS_MAX_CUSTOM, max(Attendee::PERMISSIONS_DEFAULT, (int)$configurableDefault));
}

// Falling back to an unrestricted set of permissions, only ignoring the lobby is off
return Attendee::PERMISSIONS_MAX_DEFAULT & ~Attendee::PERMISSIONS_LOBBY_IGNORE;
// Falling back to an unrestricted set of permissions, only ignoring the lobby is off and moderating calls
return Attendee::PERMISSIONS_MAX_DEFAULT & ~Attendee::PERMISSIONS_LOBBY_IGNORE & ~Attendee::PERMISSIONS_CALL_MODERATE;
}

public function getAttachmentFolder(string $userId): string {
Expand Down
14 changes: 14 additions & 0 deletions lib/Model/Attendee.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ class Attendee extends Entity {
public const PERMISSIONS_PUBLISH_VIDEO = 32;
public const PERMISSIONS_PUBLISH_SCREEN = 64;
public const PERMISSIONS_CHAT = 128;
public const PERMISSIONS_CHAT_REACTION = 256;
public const PERMISSIONS_FILE_VIEW = 512;
public const PERMISSIONS_FILE_SHARE = 1024;
nickvergessen marked this conversation as resolved.
Show resolved Hide resolved
public const PERMISSIONS_OBJECT_SHARE = 2048;
public const PERMISSIONS_WHITEBOARD = 4096;
public const PERMISSIONS_PARTICIPANTS_VIEW = 8192;
public const PERMISSIONS_CALL_MODERATE = 16384;
public const PERMISSIONS_MAX_DEFAULT = // Max int (when all permissions are granted as default)
self::PERMISSIONS_CALL_START
| self::PERMISSIONS_CALL_JOIN
Expand All @@ -95,6 +102,13 @@ class Attendee extends Entity {
| self::PERMISSIONS_PUBLISH_VIDEO
| self::PERMISSIONS_PUBLISH_SCREEN
| self::PERMISSIONS_CHAT
| self::PERMISSIONS_CHAT_REACTION
| self::PERMISSIONS_FILE_VIEW
| self::PERMISSIONS_FILE_SHARE
| self::PERMISSIONS_OBJECT_SHARE
| self::PERMISSIONS_WHITEBOARD
| self::PERMISSIONS_PARTICIPANTS_VIEW
| self::PERMISSIONS_CALL_MODERATE
;
public const PERMISSIONS_MAX_CUSTOM = self::PERMISSIONS_MAX_DEFAULT | self::PERMISSIONS_CUSTOM; // Max int (when all permissions are granted as custom)

Expand Down
Loading