about summary refs log tree commit diff
path: root/MatrixUtils.Web/Pages/Rooms/RoomCreateComponents/RoomCreatePrivacyOptions.razor
blob: 76f61c47d1b18308365955f39a36cccf0dd275b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@using LibMatrix.Helpers
<tr>
    <td style="padding-top: 16px;">Join rules:</td>
    <td style="padding-top: 16px;">
        <InputSelect @bind-Value="@roomBuilder.JoinRules.JoinRuleValue">
            <option value="public">Anyone can join</option>
            <option value="invite">Invite only</option>
            <option value="knock">Ask to join</option>
            <option value="restricted">Invite only (or mutual room)</option>
            <option value="knock_restricted">Ask to join (or mutual room)</option>
        </InputSelect>
    </td>
</tr>
<tr>
    <td>History visibility:</td>
    <td>
        <InputSelect @bind-Value="@roomBuilder.HistoryVisibility.HistoryVisibility">
            <option value="invited">Since invite</option>
            <option value="joined">Since join</option>
            <option value="shared">Since room creation (members only)</option>
            <option value="world_readable">World readable (everyone)</option>
        </InputSelect>
    </td>
</tr>
<tr>
    <td>Guest access:</td>
    <td>
        <InputCheckbox @bind-Value="roomBuilder.GuestAccess.IsGuestAccessEnabled"/>
        <span>Allow guests to join</span>
        <LinkButton InlineText="true" href="https://spec.matrix.org/v1.15/client-server-api/#guest-access" target="_blank">?</LinkButton>
    </td>
</tr>
<tr>
    <td>Server ACLs:</td>
    <td>
        @if (roomBuilder.ServerAcls?.Allow is null) {
            <p>No allow rules exist!</p>
            <LinkButton OnClick="@(() => { roomBuilder.ServerAcls!.Allow = ["*"]; })">Create sane defaults</LinkButton>
        }
        else {
            <details>
                <summary>@(roomBuilder.ServerAcls.Allow?.Count) allow rules</summary>
                <StringListEditor @bind-Items="@roomBuilder.ServerAcls.Allow"></StringListEditor>
            </details>
        }
        @if (roomBuilder.ServerAcls?.Deny is null) {
            <p>No deny rules exist!</p>
            <LinkButton OnClick="@(() => { roomBuilder.ServerAcls!.Deny = []; })">Create sane defaults</LinkButton>
        }
        else {
            <details>
                <summary>@(roomBuilder.ServerAcls.Deny?.Count) deny rules</summary>
                <StringListEditor @bind-Items="@roomBuilder.ServerAcls.Deny"></StringListEditor>
            </details>
        }
    </td>
</tr>

@code {

    [Parameter]
    public required RoomBuilder roomBuilder { get; set; }

    [Parameter]
    public required Action PageStateHasChanged { get; set; }

    [Parameter]
    public AuthenticatedHomeserverGeneric Homeserver { get; set; }

}