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 access permissions for sub-pages and "Quick Add" dashlet #245

Merged
merged 1 commit into from
Mar 17, 2021

Conversation

christianwach
Copy link
Member

Overview

Fixes this issue on Lab.

Before

Incorrect capabilities are assigned to Settings (and currently-disabled Integration) sub-pages and the "Quick Add" dashlet.

After

More appropriate capabilities are assigned to Settings (and currently-disabled Integration) sub-pages and the "Quick Add" dashlet.

Technical Details

As noted on the issue, manage_options seems a more sensible default capability than administer_civicrm for the sub-pages because administer_civicrm is not automatically granted to WordPress admins. I have added a filter for each page so that this can be overridden if required.

The "Quick Add" dashlet queries CiviCRM directly for the add_contacts permission because the permission may or may not have been granted to the WordPress User and therefore current_user_can() can't necessarily determine the User's status.

@kcristiano
Copy link
Member

I have done multiple r-run and this passes.

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

Successfully merging this pull request may close these issues.

2 participants