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

Raise privileges to get email address information #505

Merged
merged 6 commits into from
Sep 20, 2022

Conversation

bonnland
Copy link
Contributor

@bonnland bonnland commented Jun 2, 2022

There are two changes needed to get access to a user's email address for harvester emails.

The first change gives privileged access to a user's details. This is needed to access the email address.
The second change requests the "extra" information about a user, including the email address.

The first change could be avoided if, for example, the user_show action in CKAN 2.9 is changed to honor the ignore_auth value in the context. But I am not sure if the long-term plan is to honor ignore_auth. It could also be avoided if user_show honored the running user's administrative privileges, but the logic does not do this at the moment.

We are running this command as the user "harvest", which is configured to have administrative rights. But the logic in user_show is honoring the context's 'user' field in CKAN 2.9, instead of looking at the user's privileges. So it seems that a 'user' value must be added to the context with the current authorization logic used in user_show.

@bonnland bonnland changed the title raise action privileges to get email address information Raise privileges to get email address information Jun 2, 2022
ckanext/harvest/logic/action/get.py Outdated Show resolved Hide resolved
ckanext/harvest/logic/action/get.py Outdated Show resolved Hide resolved
@amercader amercader merged commit 72e9fee into ckan:master Sep 20, 2022
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