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

Fix 'Authorization Failed' regression when submitting eg. webform via checksum #23607

Merged
merged 1 commit into from
May 27, 2022

Conversation

mattwire
Copy link
Contributor

Overview

When a user accesses API3 (eg Activity.create, Case.create, EmailApi.send) and they are accessing via a checksum link (I tested using a drupal webform submission with a checksum) the API calls fail with "Authorization Failed". I traced this to the recently changed in #23099 API4 RecentItems::update()

I'm not certain if setting checkPermissions = FALSE is the correct thing to do here because this code is called on every post hook but I think that's effectively how it was working before.

Before

Cannot use API3 calls when "logged in" via a checksum.

After

Can use API3 calls when "logged in" via a checksum.

Technical Details

The user does not have "Access CiviCRM" but an "authenticated user" does have "Access AJAX API" and I think the checksum gives them "authenticated user" access? An alternative might be to open up permissions on RecentItems to "Access AJAX API"?

Comments

@colemanw @eileenmcnaughton per discussion in product-maintenance. This is a regression on 5.49.

@civibot
Copy link

civibot bot commented May 27, 2022

(Standard links)

@civibot civibot bot added the 5.50 label May 27, 2022
@eileenmcnaughton
Copy link
Contributor

@colemanw part of me wonders if we should look at the permissions model here - but this is a quick fix so even if we did look at permissions that could be in master?

@eileenmcnaughton
Copy link
Contributor

I'm gonna merge this - doesn't stop us revisiting permissions later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants