feat: don't hide information from own system when directly requested

in lists, pk;m <ref> <prop>, etc
This commit is contained in:
spiral
2021-12-07 01:32:29 -05:00
parent 56e266190f
commit 9926bbbd8b
10 changed files with 38 additions and 31 deletions

View File

@@ -9,9 +9,13 @@ public class SystemList
public async Task MemberList(Context ctx, PKSystem target)
{
if (target == null) throw Errors.NoSystemError;
ctx.CheckSystemPrivacy(target, target.MemberListPrivacy);
ctx.CheckSystemPrivacy(target.Id, target.MemberListPrivacy);
var opts = ctx.ParseMemberListOptions(ctx.LookupContextFor(target.Id));
// explanation of privacy lookup here:
// - ParseMemberListOptions checks list access privacy and sets the privacy filter (which members show up in list)
// - RenderMemberList checks the indivual privacy for each member (NameFor, etc)
// the own system is always allowed to look up their list
var opts = ctx.ParseMemberListOptions(ctx.DirectLookupContextFor(target.Id));
await ctx.RenderMemberList(
ctx.LookupContextFor(target.Id),
target.Id,