Add system and member privacy support

This commit is contained in:
Ske
2020-01-11 16:49:20 +01:00
parent f0cc5c5961
commit 98613c4287
17 changed files with 317 additions and 59 deletions

View File

@@ -11,10 +11,12 @@ namespace PluralKit.API.Controllers
public class AccountController: ControllerBase
{
private IDataStore _data;
private TokenAuthService _auth;
public AccountController(IDataStore data)
public AccountController(IDataStore data, TokenAuthService auth)
{
_data = data;
_auth = auth;
}
[HttpGet("{aid}")]
@@ -23,7 +25,7 @@ namespace PluralKit.API.Controllers
var system = await _data.GetSystemByAccount(aid);
if (system == null) return NotFound("Account not found.");
return Ok(system.ToJson());
return Ok(system.ToJson(_auth.ContextFor(system)));
}
}
}