Aggregate document permissions for current user in API response (#18721)
* Create integration test verifying existing behaviour. * Aggregate permissions per document for the current user response. * Refactoring following Codescene warnings.
This commit is contained in:
@@ -159,7 +159,7 @@ public class UserGroupBuilder<TParent>
|
||||
Key = key,
|
||||
StartContentId = startContentId,
|
||||
StartMediaId = startMediaId,
|
||||
Permissions = _permissions
|
||||
Permissions = _permissions,
|
||||
};
|
||||
|
||||
BuildAllowedSections(userGroup);
|
||||
@@ -169,7 +169,6 @@ public class UserGroupBuilder<TParent>
|
||||
return userGroup;
|
||||
}
|
||||
|
||||
|
||||
private void BuildAllowedSections(UserGroup userGroup)
|
||||
{
|
||||
foreach (var section in _allowedSections)
|
||||
@@ -204,6 +203,6 @@ public class UserGroupBuilder<TParent>
|
||||
.WithAlias(alias + suffix)
|
||||
.WithName(name + suffix)
|
||||
.WithPermissions(permissions ?? new[] { "A", "B", "C" }.ToHashSet())
|
||||
.WithAllowedSections(allowedSections ?? new[] { "content", "media" })
|
||||
.WithAllowedSections(allowedSections ?? ["content", "media"])
|
||||
.Build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user