From c2d10b63d28e1302bcb572e7ab7d3a80e3042780 Mon Sep 17 00:00:00 2001 From: Kim Date: Thu, 23 Mar 2023 15:45:40 +0100 Subject: [PATCH] rewrote getchildusers --- csharp/App/Backend/Controllers/Controller.cs | 14 ++++++++++++-- csharp/App/OpenVpnCertificatesServer/newToken.sh | 0 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 csharp/App/OpenVpnCertificatesServer/newToken.sh diff --git a/csharp/App/Backend/Controllers/Controller.cs b/csharp/App/Backend/Controllers/Controller.cs index df0d4304a..627e52c02 100644 --- a/csharp/App/Backend/Controllers/Controller.cs +++ b/csharp/App/Backend/Controllers/Controller.cs @@ -171,8 +171,8 @@ public class Controller : ControllerBase return folder; } - [HttpGet(nameof(GetAllChildUsers))] - public ActionResult> GetAllChildUsers(Token authToken) + [HttpGet(nameof(GetAllDirectChildUsers))] + public ActionResult> GetAllDirectChildUsers(Token authToken) { var user = Db.GetSession(authToken)?.User; if (user == null) @@ -181,6 +181,16 @@ public class Controller : ControllerBase return user.ChildUsers().ToList(); } + [HttpGet(nameof(GetAllChildUsers))] + public ActionResult> GetAllChildUsers(Token authToken) + { + var user = Db.GetSession(authToken)?.User; + if (user == null) + return Unauthorized(); + + return user.DescendantUsers().ToList(); + + [HttpGet(nameof(GetAllInstallations))] public ActionResult> GetAllInstallations(Token authToken) { diff --git a/csharp/App/OpenVpnCertificatesServer/newToken.sh b/csharp/App/OpenVpnCertificatesServer/newToken.sh new file mode 100644 index 000000000..e69de29bb