diff --git a/csharp/App/Backend/Controllers/Controller.cs b/csharp/App/Backend/Controllers/Controller.cs index 91c5e012e..b7935922b 100644 --- a/csharp/App/Backend/Controllers/Controller.cs +++ b/csharp/App/Backend/Controllers/Controller.cs @@ -174,8 +174,7 @@ public class Controller using var db = Db.Connect(); var folders = db - .GetDirectlyAccessibleFolders(caller) - .Do(f => f.ParentId = 0) // ReSharper disable once AccessToDisposedClosure + .GetDirectlyAccessibleFolders(caller) // ReSharper disable once AccessToDisposedClosure .Select(f => PopulateChildren(db, f)); var installations = db.GetDirectlyAccessibleInstallations(caller); diff --git a/csharp/App/Backend/Database/Db.cs b/csharp/App/Backend/Database/Db.cs index f8ff601bd..1625c128f 100644 --- a/csharp/App/Backend/Database/Db.cs +++ b/csharp/App/Backend/Database/Db.cs @@ -111,7 +111,8 @@ public partial class Db : IDisposable .Where(r => r.UserId == user.Id) .Select(r => r.InstallationId) .Select(GetInstallationById) - .NotNull(); + .NotNull() + .Do(i => i.ParentId = 0); // hide inaccessible parents from calling user } public IEnumerable GetDirectlyAccessibleFolders(User user) @@ -120,7 +121,8 @@ public partial class Db : IDisposable .Where(r => r.UserId == user.Id) .Select(r => r.FolderId) .Select(GetFolderById) - .NotNull(); + .NotNull() + .Do(i => i.ParentId = 0); // hide inaccessible parents from calling user; } public Result AddToAccessibleInstallations(Int64 userId, Int64 updatedInstallationId)