Skip to content

Commit a8dcb45

Browse files
authored
Merge pull request #56 from jagerman/room-accessible
Room accessible flag & DB migration refactor
2 parents 18617cb + dff6ec7 commit a8dcb45

20 files changed

+877
-540
lines changed

api.yaml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ paths:
3737
tags: [Rooms]
3838
summary: "Returns a list of available rooms on the server."
3939
description: >
40-
Rooms to which the user does not have access (e.g. because they are banned) are not
41-
included.
40+
Rooms to which the user does not have access (e.g. because they are banned or the room or
41+
requires specific access) are not included.
4242
responses:
4343
200:
4444
description: successful operation
@@ -63,8 +63,8 @@ paths:
6363
$ref: "#/components/schemas/Room"
6464
403:
6565
description: >
66-
Forbidden. Returned if the user is banned from the room or otherwise does not have read
67-
access to the room.
66+
Forbidden. Returned if the user is banned from the room or does not have access to the
67+
room.
6868
content: {}
6969
put:
7070
tags: [Rooms]
@@ -104,6 +104,15 @@ paths:
104104
Sets the default "read" permission (if true: users can read messages) for users
105105
in this room who do not otherwise have specific permissions applied.
106106
example: true
107+
default_accessible:
108+
type: boolean
109+
description: >
110+
Sets the default "accessible" permission for users in this room who do not
111+
otherwise have specific permissions applied. This accessible permission only
112+
affects users who do not have read permission: accessible without read still
113+
allows the user to access room metadata (but not messages), while both false
114+
prevents room metadata access as well.
115+
example: true
107116
default_write:
108117
type: boolean
109118
description: >
@@ -186,6 +195,8 @@ paths:
186195
$ref: "#/components/schemas/Room/properties/global_admin"
187196
default_read:
188197
$ref: "#/components/schemas/Room/properties/default_read"
198+
default_accessible:
199+
$ref: "#/components/schemas/Room/properties/default_accessible"
189200
default_write:
190201
$ref: "#/components/schemas/Room/properties/default_write"
191202
default_upload:
@@ -1043,6 +1054,17 @@ paths:
10431054
room's messages even if the room's default allows reading. Specifying this as
10441055
null will explicitly delete any user-specific read override (effectively
10451056
returning the user's read permission to the room's default).
1057+
accessible:
1058+
type: boolean
1059+
nullable: true
1060+
example: false
1061+
description: >
1062+
If true this grants permission to read the room's metadata when the user doesn't
1063+
have read permission. That is, having this true and read false means the user
1064+
cannot read messages, but can get information about the room, while both false
1065+
means the user cannot access any details of the room. Specifying this as null
1066+
will explicitly delete any user-specific accessible override, returning the
1067+
user's effective permission to the room's default.
10461068
write:
10471069
type: boolean
10481070
nullable: true
@@ -1659,6 +1681,15 @@ components:
16591681
Whether new users have permission to read posts in this room by default. This property
16601682
is only returned if the calling user has moderator/admin permissions.
16611683
example: true
1684+
default_accessible:
1685+
type: boolean
1686+
description: >
1687+
Whether new users have permission to access this room's information. This property only has
1688+
an effect for users who do not have read permission; it is designed to be set to false
1689+
(along with default_read) in order to create a room that users can neither read messages
1690+
from nor access any room metadata. This property is only returned if the calling user
1691+
has moderator/admin permissions.
1692+
example: true
16621693
default_write:
16631694
type: boolean
16641695
description: >

0 commit comments

Comments
 (0)