Skip to content

Commit

Permalink
Remove itemIds from FieldAccessArgs (#4936)
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie authored Feb 25, 2021
1 parent 884129f commit 6469362
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/selfish-singers-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-next/keystone': major
---

Removed `itemIds` from `FieldAccessArgs` and no longer pass this value into field level imperative access control rules.
9 changes: 1 addition & 8 deletions packages-next/keystone/src/lib/createAccessControlContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type FieldAccessArgs = {
originalInput: any;
gqlName: string;
itemId: any;
itemIds: any;
context: KeystoneContext;
item: any;
fieldKey: string;
Expand Down Expand Up @@ -124,12 +123,7 @@ export const accessControlContext = {
originalInput: FieldAccessArgs['originalInput'],
item: FieldAccessArgs['item'],
operation: FieldAccessArgs['operation'],
{
gqlName,
itemId,
itemIds,
context,
}: Pick<FieldAccessArgs, 'gqlName' | 'itemId' | 'itemIds' | 'context'>
{ gqlName, itemId, context }: Pick<FieldAccessArgs, 'gqlName' | 'itemId' | 'context'>
) {
return validateFieldAccessControl({
access: access[context.schemaName],
Expand All @@ -141,7 +135,6 @@ export const accessControlContext = {
listKey,
gqlName,
itemId,
itemIds,
context,
});
},
Expand Down

1 comment on commit 6469362

@vercel
Copy link

@vercel vercel bot commented on 6469362 Feb 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.