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

APIv4 - Fix checkAccess for CiviCase or other entities with nonstandard class names #22090

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Nov 17, 2021

Overview

Fixes https://lab.civicrm.org/dev/core/-/issues/2950

Before

APIv4 mistakenly thinks the lowercase entity name is 'civi_case' before applying permissions.

After

Correctly registers as 'case' and permissions are correctly looked up.

Technical Details

The use of self::getEntityName() instead of static::getEntityName() was causing the overridden Civi\Api4\CiviCase::getEntityName() to be overlooked.

@civibot
Copy link

civibot bot commented Nov 17, 2021

(Standard links)

@civibot civibot bot added the master label Nov 17, 2021
@AsylumSeekersCentre
Copy link
Contributor

I have tested this change on 5.43.2, and I can confirm that it resolves this issue for us: https://lab.civicrm.org/dev/core/-/issues/2950

@seamuslee001
Copy link
Contributor

Merging based on review from @AsylumSeekersCentre

@seamuslee001 seamuslee001 merged commit d910608 into civicrm:master Nov 22, 2021
@seamuslee001 seamuslee001 deleted the apiGetEntityName branch November 22, 2021 00:07
@highfalutin
Copy link
Contributor

Thanks for your work on this @AsylumSeekersCentre and @colemanw, we ran into the same issue and are very happy to see it solved!

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

Successfully merging this pull request may close these issues.

4 participants