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

Update .sudo() to use the internal schema #5084

Merged
merged 1 commit into from
Mar 11, 2021
Merged

Update .sudo() to use the internal schema #5084

merged 1 commit into from
Mar 11, 2021

Conversation

timleslie
Copy link
Contributor

@timleslie timleslie commented Mar 9, 2021

The static access control rule access: false will remove the related queries/mutations from the graphQL schema. When using the .sudo() context we want to be able to run commands while ignoring access control. This implies that we should be able to execute the queries/mutations associated with the item marked access: false.

To make this work we can take advantage of the internal schema which is provided by Keystone core, which is a full version of the schema without any of the operations removed.

The net impact of this change is to have .sudo() behave the way a user would expect, in that they can perform all possible operations in the system.

This change is required in order for us to test the access control package, as we need to be able to execute mutations on lists with { access: false }.

@vercel
Copy link

vercel bot commented Mar 9, 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/CL4zFiLUhjiD58L21EWDkzSHsEpY
✅ Preview: https://keystone-next-docs-git-internal-sudo-keystonejs.vercel.app

@changeset-bot
Copy link

changeset-bot bot commented Mar 9, 2021

🦋 Changeset detected

Latest commit: 5414063

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@keystone-next/keystone Minor
@keystone-next/types Minor
@keystone-next/test-utils-legacy Patch
@keystone-next/auth Major
@keystone-next/example-auth Patch
@keystone-next/app-basic Patch
@keystone-next/example-ecommerce Patch
keystone-next-app Patch
@keystone-next/example-roles Patch
@keystone-next/example-todo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel vercel bot temporarily deployed to Preview – keystone-prisma-on-vercel-experimenting March 10, 2021 00:41 Inactive
@vercel vercel bot temporarily deployed to Preview – keystone-next-docs March 10, 2021 00:41 Inactive
@timleslie timleslie changed the title [WIP] Update .sudo() to use the internal schema Update .sudo() to use the internal schema Mar 10, 2021
@timleslie timleslie requested a review from JedWatson March 10, 2021 00:44
@vercel vercel bot temporarily deployed to Preview – keystone-prisma-on-vercel-experimenting March 10, 2021 03:09 Inactive
@vercel vercel bot temporarily deployed to Preview – keystone-next-docs March 10, 2021 03:09 Inactive
@vercel vercel bot temporarily deployed to Preview March 10, 2021 22:47 Inactive
@vercel vercel bot temporarily deployed to Preview March 11, 2021 04:41 Inactive
@vercel vercel bot temporarily deployed to Preview March 11, 2021 04:46 Inactive
@timleslie timleslie enabled auto-merge (squash) March 11, 2021 04:46
@timleslie timleslie merged commit 40d4fff into master Mar 11, 2021
@timleslie timleslie deleted the internal-sudo branch March 11, 2021 04:54
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