Skip to content

Commit 24d9d97

Browse files
committed
make ApiPermissions non-nullable
1 parent fdf33e4 commit 24d9d97

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/Client/PlayerState.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ namespace Beefweb.Client;
88
/// </summary>
99
public sealed class PlayerState
1010
{
11+
private ApiPermissions? _permissions;
12+
1113
/// <summary>
1214
/// Information about current player.
1315
/// </summary>
@@ -48,13 +50,25 @@ public sealed class PlayerState
4850
public VolumeInfo Volume { get; set; } = null!;
4951

5052
/// <summary>
51-
/// Current permissions.
53+
/// Current API permissions.
5254
/// </summary>
5355
/// <remarks>
5456
/// API is available since Beefweb v0.10
55-
/// For earlier versions value is null.
57+
/// For earlier versions value contains <see cref="ApiPermissions"/> object with all permissions enabled.
5658
/// </remarks>
57-
public ApiPermissions? Permissions { get; set; }
59+
public ApiPermissions Permissions
60+
{
61+
get
62+
{
63+
return _permissions ??= new ApiPermissions
64+
{
65+
ChangePlaylists = true,
66+
ChangeOutput = true,
67+
ChangeClientConfig = true,
68+
};
69+
}
70+
set => _permissions = value;
71+
}
5872

5973
/// <summary>
6074
/// Gets option with specified <paramref name="id"/>.

0 commit comments

Comments
 (0)