Skip to content

Commit cc2b928

Browse files
authored
ContentLink target is not visible if the user has not "See" permission on it. (#2211)
1 parent 99413b8 commit cc2b928

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/ContentRepository.InMemory/InMemoryIndex.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ public void Delete(SnTerm term)
197197
deletableVersionIds.AddRange(versionIds);
198198
}
199199

200-
// delete all version ids in any depth
200+
// Delete all version ids in any depth
201+
// The class is not thread safe. Sometimes there is an
202+
// InvalidOperationException in the following "foreach" cycle:
203+
// "Collection was modified; enumeration operation may not execute."
201204
var indexesToDelete = new List<string>();
202205
foreach (var item in IndexData)
203206
{

src/Storage/NodeList.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,11 @@ internal Q GetSingleValue<Q>() where Q : Node
563563

564564
using var systemAccount = new SystemAccount();
565565

566-
var user = AccessProvider.Current.GetCurrentUser();
566+
var user = AccessProvider.Current.GetOriginalUser();
567567

568568
var singleNode = RawData
569-
.Select(id => Node.Load<T>(id))
569+
.Select(Node.Load<T>)
570+
.Where(node => node != null)
570571
.OfType<Q>()
571572
.FirstOrDefault(node =>
572573
node.Security.HasPermission(user, PermissionType.See));

0 commit comments

Comments
 (0)