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

CRM-20430 - Permission 'save Report Criteria'. #12107

Merged
merged 1 commit into from
Jun 9, 2018

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented May 10, 2018

Overview

Nuance report permissions, adding a new save report criteria permission

Before

Without or with permission
screenshot 2018-05-10 18 27 38

After

Without permission

screenshot 2018-05-10 18 26 52

With permission
screenshot 2018-05-10 18 29 04

Technical Details

I am torn between renaming the perm to 'edit report_templates' for consistency with other entities or sticking with 'save Report Criteria' to be more consistent with other report perms - per original submitter

Comments

This is a recut of #10164 with the things that were blocking it tweaked. It does makes sense & has made sense to others - however, I won't keep this open if it is not merged by the time the 5.3 rc is recut that is it's 'last chance'


Copy link
Contributor

@tschuettler tschuettler left a comment

Choose a reason for hiding this comment

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

(CiviCRM Review Template WORD-1.1)

  • (r-explain) Pass
  • (r-test) Pass
  • (r-code) Pass
  • (r-doc) Pass
  • (r-maint) Pass
  • (r-run) Pass: Can save or copy reports with the new permission. Don't have the option to do so without it.
  • (r-user) Pass: A pre-upgrade warning to review the permissions exists.
  • (r-tech) Issue: see below
  • (rg-upgrades) Issue: Pre-upgrade message is displayed twice when upgrading from <4.7.32.
  • (rg-perm) Undecided: Should this permission be added to the civicrm_webtest_user role in civibuild or civicrm_webtest.install so that users can test saving reports on dmaster demo?

@@ -84,6 +84,7 @@ public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NU
}
if ($rev == '4.7.32') {
$preUpgradeMessage .= '<p>' . ts('A new %1 permission has been added. It is not granted by default. If you use SMS, you may wish to review your permissions.', array(1 => 'send SMS')) . '</p>';
$preUpgradeMessage .= '<p>' . ts('A new %1 permission has been added. It is not granted by default. If your users create reports, you may wish to review your permissions.', array(1 => 'save Report Criteria')) . '</p>';
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to be a leftover from the previous PR.

@eileenmcnaughton eileenmcnaughton force-pushed the save_report branch 2 times, most recently from 714515b to 356401e Compare May 11, 2018 12:46
@eileenmcnaughton
Copy link
Contributor Author

@tschuettler thanks for the review - I've fixed the 4.7.32 double up. Good point about demo site permissions - I feel like this is something that has been off our radar when adding perms - @totten how do we best handle / audit this

(current test failure is not related I believe -looks like server resources)

@tschuettler
Copy link
Contributor

Thanks @eileenmcnaughton!
There was #9785 that did add permissions. It feels reasonable to add it directly.

(Seems like the installation did not even finish this time since the mysql server was down)

@eileenmcnaughton
Copy link
Contributor Author

Hmm - are those permissions what is not used in buildkit or are they legacy - I think this might be where I need to add them - https://github.com/civicrm/civicrm-buildkit/search?utf8=%E2%9C%93&q=access_civimail&type=

@eileenmcnaughton
Copy link
Contributor Author

test this please

1 similar comment
@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton
Copy link
Contributor Author

@totten can you comment on where we need to add permissions for the buildkit / demo environment?

@totten
Copy link
Member

totten commented Jun 8, 2018

@eileenmcnaughton -- @tschuettler's reference to civicrm_webtest should be correct. In the build scripts, the first step for setting permissions to enable civicrm_webtest:

Note: the drupal-demo site goes a bit further and assigns additional permissions.

Phrased another way:

  • If you want to apply the permission broadly (on all test/demo systems), update civicrm_webtest.install
  • If you want to apply the permission on a narrower subset (e.g. only test sites; or only demo sites), then update the app/config/<foo>/install.sh in civicrm-buildkit.

@eileenmcnaughton
Copy link
Contributor Author

hmm - that's intuitive - update a drupal module for generic permissions. I don't even want to ask about WP & Joomla! :-) Doing it now & will merge this once done as I feel this satisfies the review

If you don't have the permission, the 'save report' actions aren't shown
on the form of the report instance.

CRM-20430 - Check 'save Report Criteria' permission before saving a report instance.

Coding style issues.

Added a pre-commit message about the new permission.
@eileenmcnaughton
Copy link
Contributor Author

unrelated fail - merging

@eileenmcnaughton eileenmcnaughton merged commit f2e0df0 into civicrm:master Jun 9, 2018
@eileenmcnaughton eileenmcnaughton deleted the save_report branch June 9, 2018 01:32
@tschuettler
Copy link
Contributor

yay!
I guess the issue can be closed now :)

@eileenmcnaughton
Copy link
Contributor Author

@tschuettler good idea!

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.

5 participants