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

Code cleanup - remove extraneous permissions clause #13645

Merged
merged 1 commit into from
Feb 26, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Minor code cleanup - removes redundant clause when financial acls in play

Before

financial type clause added by buildPermissions AND when it is a critieria

After

Clause not added twice in that scenario (still added twice when the default clause is hit which I have not addressed in this PR

Technical Details

As the test demonstrates this permission is applied without this line. It is applied
even when the skipPermission is TRUE but that has been code-commented for now rather
than resolved

Comments

@monishdeb this one is a safe & minor cleanup - respecting skipPermissions might need some more testing but we will need to do that at some point

As the test demonstrates this permission is applied without this line. It is applied
even when the skipPermission is TRUE but that has been code-commented for now rather
than resolved
@civibot
Copy link

civibot bot commented Feb 20, 2019

(Standard links)

@civibot civibot bot added the master label Feb 20, 2019
@eileenmcnaughton eileenmcnaughton changed the title Code cleanup - remove extraneous permissions clase Code cleanup - remove extraneous permissions clause Feb 21, 2019
@@ -237,9 +237,6 @@ public static function whereClauseSingle(&$values, &$query) {
return;

case 'financial_type_id':
// @todo we need to make this resemble a hook approach.
CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes);
$query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_contribution.$name", 'IN', array_keys($financialTypes), 'String');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this line is the actual change - test shows it doesn't stop the ACL being applied - clause is being added twice

@eileenmcnaughton
Copy link
Contributor Author

@pradpnayak maybe you can check this - it's pretty simple - just adds a test to prove the removed line is just a duplicate clause

@colemanw colemanw merged commit 55cf4e4 into civicrm:master Feb 26, 2019
@colemanw
Copy link
Member

Merging based on code review & passing tests.

@colemanw colemanw deleted the ft_acl_test branch February 26, 2019 18:34
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.

2 participants