Skip to content

Updated contextUser to handle context.api_key_id #9977

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

Closed
wants to merge 2 commits into from
Closed

Updated contextUser to handle context.api_key_id #9977

wants to merge 2 commits into from

Conversation

allouis
Copy link
Contributor

@allouis allouis commented Oct 10, 2018

ℹ️ Split out from #9869 ℹ️

👐 refs #9865 👐

This updates the contextUser method to use the id of
context.api_key_user. This means we can set the api_key_user context and
all updated_by/created_by will use the correct user for the api key.

no-issue

This just cleans up the default options parameter and doesn't mutate the
options object passed in.
refs #9865

This updates the contextUser method to use the id of
context.api_key_user. This means we can set the api_key_user context and
all updated_by/created_by will use the correct user for the api key.
options = options || {};
options.context = options.context || {};
contextUser: function contextUser(options = {}) {
const context = options.context || {};

This comment was marked as abuse.

@allouis allouis changed the title Api key/context user Updated contextUser to handle context.api_key_id Oct 10, 2018
const context = options.context || {};

if (context.api_key_id && context.api_key_user && context.api_key_user.get('id')) {
return context.api_key_user.get('id');

This comment was marked as abuse.

This comment was marked as abuse.

@naz
Copy link
Contributor

naz commented Oct 10, 2018

Just in case @rishabhgrg is to review this PR, looking at #9976 helps to understand the context of the change ;)

@allouis allouis closed this Oct 10, 2018
@allouis allouis deleted the api-key/contextUser branch January 29, 2019 09:40
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.

4 participants