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

dev/drupal#89 Drupal 8 version of checkGroupRole #16273

Merged
merged 1 commit into from
Jan 15, 2020

Conversation

demeritcowboy
Copy link
Contributor

Overview

Follow-on from #15318. The UI for the roles widget on the Access tab of CiviReports is fixed by that PR but it doesn't actually have any effect on access because the implementation of CRM_Core_Permission::checkGroupRole ends up using the D6/D7 version which doesn't work in D8. So that needed updating too, which is this PR.

Before

You can select a role but it doesn't affect access.

After

Role-based access works like in D7.

Technical Details

$GLOBALS['user'] doesn't exist in D8. This adds an override version of checkGroupRole in Drupal8.php.

Comments

If you're testing note that if the user has Administer Reports permission in the CMS then that overrides anything on the access tab of a report.

@jitendrapurohit

@civibot
Copy link

civibot bot commented Jan 10, 2020

(Standard links)

@civibot civibot bot added the master label Jan 10, 2020
@demeritcowboy
Copy link
Contributor Author

jenkins retest this please

@seamuslee001
Copy link
Contributor

(CiviCRM Review Template WORD-1.2)

  • General standards
    • (r-explain) Pass
    • (r-user) Pass
    • (r-doc) Pass
    • (r-run) I tested this by making a specific report available to a specific role. Granted a test user that specific role, confirmed without this patch they couldn't access the role, confirmed that with the patch they could access the report. Also confirmed that if the report was limited to a role that the user didn't have it blocked access.
  • Developer standards

@seamuslee001 seamuslee001 merged commit 2530c42 into civicrm:master Jan 15, 2020
@demeritcowboy demeritcowboy deleted the d8-check-group-roles branch January 16, 2020 15:06
@demeritcowboy
Copy link
Contributor Author

Thanks

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.

3 participants