Set parentId=0 already in DB layer, not in controller
This commit is contained in:
parent
e6fa2933b5
commit
faf35be6cf
|
@ -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);
|
||||
|
|
|
@ -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<Folder> 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)
|
||||
|
|
Loading…
Reference in New Issue