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

Use AuthedRelationship to power byTracking #2811

Merged
merged 1 commit into from
Apr 23, 2020

Conversation

jesstelford
Copy link
Contributor

@jesstelford jesstelford commented Apr 23, 2020

NOTE: The failing test is due to a different bug fixed in #2813

Noticed some of this logic was duplicated, so figured we could just re-use what exists to simplify the byTracking code.

Things AuthedRelationship handles for us:

  • Setting the access control to { create: false, read: true, update: false }
  • Setting the createdBy value on creation

Things AuthedRelationship fixes for us:

  • Merging different access control settings in using standard access: { ... } syntax. ie; to toggle read: false, all it takes is a access: { read: false } instead of currently which requires re-specifying all three options, potentially leading to subtle bugs which make the access too permissive.
  • Correctly handling the isRequired flag on create

@changeset-bot
Copy link

changeset-bot bot commented Apr 23, 2020

🦋 Changeset is good to go

Latest commit: f550dba

We got this.

This PR includes changesets to release 1 package
Name Type
@keystonejs/list-plugins Minor

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

@jesstelford jesstelford force-pushed the bytracking-authedrelationship branch 3 times, most recently from bc865e8 to 2dfa0b7 Compare April 23, 2020 04:48
@jesstelford jesstelford force-pushed the bytracking-authedrelationship branch from 2dfa0b7 to f550dba Compare April 23, 2020 05:02
@jesstelford jesstelford merged commit 003c604 into master Apr 23, 2020
@jesstelford jesstelford deleted the bytracking-authedrelationship branch April 23, 2020 05:12
@github-actions github-actions bot mentioned this pull request Apr 23, 2020
Wkasel pushed a commit to gosignal/keystone that referenced this pull request Apr 30, 2020
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.

None yet

2 participants