enable start node calculation (#15813)

This commit is contained in:
Nikolaj Geisle
2024-03-01 14:18:22 +01:00
committed by GitHub
parent a9c0e10595
commit 7c33afa3a9
2 changed files with 24 additions and 36 deletions

View File

@@ -63,23 +63,17 @@ public abstract class DocumentTreeControllerBase : UserStartNodeTreeControllerBa
return responseModel;
}
// TODO: delete these (faking start node setup for unlimited editor)
protected override int[] GetUserStartNodeIds() => new[] { -1 };
protected override int[] GetUserStartNodeIds()
=> _backofficeSecurityAccessor
.BackOfficeSecurity?
.CurrentUser?
.CalculateContentStartNodeIds(EntityService, _appCaches)
?? Array.Empty<int>();
protected override string[] GetUserStartNodePaths() => Array.Empty<string>();
// TODO: use these implementations instead of the dummy ones above once we have backoffice auth in place
// protected override int[] GetUserStartNodeIds()
// => _backofficeSecurityAccessor
// .BackOfficeSecurity?
// .CurrentUser?
// .CalculateContentStartNodeIds(EntityService, _appCaches)
// ?? Array.Empty<int>();
//
// protected override string[] GetUserStartNodePaths()
// => _backofficeSecurityAccessor
// .BackOfficeSecurity?
// .CurrentUser?
// .GetContentStartNodePaths(EntityService, _appCaches)
// ?? Array.Empty<string>();
protected override string[] GetUserStartNodePaths()
=> _backofficeSecurityAccessor
.BackOfficeSecurity?
.CurrentUser?
.GetContentStartNodePaths(EntityService, _appCaches)
?? Array.Empty<string>();
}

View File

@@ -59,23 +59,17 @@ public class MediaTreeControllerBase : UserStartNodeTreeControllerBase<MediaTree
return responseModel;
}
// TODO: delete these (faking start node setup for unlimited editor)
protected override int[] GetUserStartNodeIds() => new[] { -1 };
protected override int[] GetUserStartNodeIds()
=> _backofficeSecurityAccessor
.BackOfficeSecurity?
.CurrentUser?
.CalculateMediaStartNodeIds(EntityService, _appCaches)
?? Array.Empty<int>();
protected override string[] GetUserStartNodePaths() => Array.Empty<string>();
// TODO: use these implementations instead of the dummy ones above once we have backoffice auth in place
// protected override int[] GetUserStartNodeIds()
// => _backofficeSecurityAccessor
// .BackOfficeSecurity?
// .CurrentUser?
// .CalculateMediaStartNodeIds(EntityService, _appCaches)
// ?? Array.Empty<int>();
//
// protected override string[] GetUserStartNodePaths()
// => _backofficeSecurityAccessor
// .BackOfficeSecurity?
// .CurrentUser?
// .GetMediaStartNodePaths(EntityService, _appCaches)
// ?? Array.Empty<string>();
protected override string[] GetUserStartNodePaths()
=> _backofficeSecurityAccessor
.BackOfficeSecurity?
.CurrentUser?
.GetMediaStartNodePaths(EntityService, _appCaches)
?? Array.Empty<string>();
}