Class LocalServerAdmin
The dashboard's view of the server it runs in: its services, called directly.
Inheritance
LocalServerAdmin
Assembly: uniform-chat-server.dll
public sealed class LocalServerAdmin : IServerAdmin
Constructors
|
Edit this page
View Source
The dashboard's view of the server it runs in: its services, called directly.
Declaration
public LocalServerAdmin(AdminService admin, ReportService reports, ServerStatus status, IServer server, IOptions<ServerOptions> options, IOptions<ServerStorageOptions> storage, IHostEnvironment environment, FileLoggerProvider fileLogger, SettingsStore settings)
Parameters
Methods
|
Edit this page
View Source
Create an account named name, the part before the colon; return its user ID; fail when it exists.
Declaration
public Task<string> CreateUserAsync(string name, string password, bool isAdmin, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Declaration
public Task DeleteReportAsync(long reportId, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Return the users' reports, newest first; resolved ones with includeResolved.
Declaration
public Task<IReadOnlyList<Report>> GetReportsAsync(bool includeResolved, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Return the server's rooms.
Declaration
public Task<IReadOnlyList<AdminRoom>> GetRoomsAsync(CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Return the counters, addresses and files.
Declaration
public Task<ServerSnapshot> GetSnapshotAsync(CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Return the local accounts, deactivated ones too.
Declaration
public Task<IReadOnlyList<AdminUser>> GetUsersAsync(CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Set a new password, logging out every device of the account.
Declaration
public Task ResetPasswordAsync(string userId, string password, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Give or take server admin rights.
Declaration
public Task SetAdminAsync(string userId, bool isAdmin, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Deactivate an account, or reactivate it.
Declaration
public Task SetDeactivatedAsync(string userId, bool deactivated, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Lock an account, or unlock it.
Declaration
public Task SetLockedAsync(string userId, bool locked, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
List a room in the public room directory, or take it out.
Declaration
public Task SetPublishedAsync(string roomId, bool published, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Resolve a report, or open it again.
Declaration
public Task SetResolvedAsync(long reportId, bool resolved, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Suspend an account, or end its suspension.
Declaration
public Task SetSuspendedAsync(string userId, bool suspended, CancellationToken cancellationToken)
Parameters
Returns
Implements