Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove itemId from FieldAccessArgs #4935

Merged
merged 2 commits into from
Feb 25, 2021
Merged

Conversation

timleslie
Copy link
Contributor

Found this gap while documenting the access-control API in #4922

@vercel
Copy link

vercel bot commented Feb 24, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/DFyu4jZodWsb5HthnidwoWnj4Q2c
✅ Preview: https://keystone-next-docs-git-field-access-read-item-id-keystonejs.vercel.app

@timleslie timleslie enabled auto-merge (squash) February 24, 2021 03:41
@emmatown emmatown requested review from a team, bladey and molomby and removed request for a team, bladey and molomby February 24, 2021 04:16
Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

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

What's the rationale behind this if they already receive the item?

@timleslie
Copy link
Contributor Author

What's the rationale behind this if they already receive the item?

Very good question 🤔 it ostensibly makes the arguments for FieldAccessArgs match those for ListAccessArgs.

On reflection, there are slight differences in the semantics of itemId in each of these cases, which might lead to confusion. I think you're right, we'd be better off completely removing the itemId from FieldAccessArgs.

Once the API docs PR has landed I'll change this PR to remove itemId and make sure the docs come along for the ride 👍

@timleslie timleslie marked this pull request as draft February 25, 2021 00:22
auto-merge was automatically disabled February 25, 2021 00:22

Pull request was converted to draft

@timleslie timleslie changed the title Pass itemId to field-level access checks on read [WIP] Remove itemId from FieldAccessArgs Feb 25, 2021
@timleslie timleslie force-pushed the field-access-read-item-id branch from 0437efd to 794d76b Compare February 25, 2021 01:06
@vercel vercel bot temporarily deployed to Preview February 25, 2021 01:07 Inactive
@timleslie timleslie force-pushed the field-access-read-item-id branch from 794d76b to 059ca15 Compare February 25, 2021 02:49
@timleslie timleslie marked this pull request as ready for review February 25, 2021 02:49
@vercel vercel bot temporarily deployed to Preview February 25, 2021 02:49 Inactive
@timleslie timleslie requested a review from emmatown February 25, 2021 02:49
@timleslie timleslie changed the title [WIP] Remove itemId from FieldAccessArgs Remove itemId from FieldAccessArgs Feb 25, 2021
Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

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

Do you know if there is a FieldAccessArgs or something in @keystone-next/types that would also have itemId on it?

.changeset/mean-lions-suffer.md Outdated Show resolved Hide resolved
@timleslie
Copy link
Contributor Author

Do you know if there is a FieldAccessArgs or something in @keystone-next/types that would also have itemId on it?

So... there are, but they're already a little bit broken and somewhat tricky to work with. I have another branch in the works which brings all this stuff up to date with reality, so I'll make sure that this change is reflected in there when it lands.

@vercel vercel bot temporarily deployed to Preview February 25, 2021 02:59 Inactive
@timleslie timleslie enabled auto-merge (squash) February 25, 2021 03:04
@timleslie timleslie merged commit 562cccb into master Feb 25, 2021
@timleslie timleslie deleted the field-access-read-item-id branch February 25, 2021 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants