question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Introduce new capabilities for viewing secondary elements

See original GitHub issue

Feature Description

Site Kit’s primary features live in its dashboard view, but there are a few substantial “secondary” elements which fall outside of the main area, particularly the WordPress dashboard “Site Kit Summary” widget, and the admin bar integration on the frontend. These currently both rely on the custom VIEW_DASHBOARD capability, however in the context of dashboard sharing, this is potentially not sufficient as a user may have the ability to view the shared dashboard, but lack access to Search Console or Analytics. These two locations are unique in that they have a hardcoded layout that relies on these two modules only. If the user does not have access to at least one of them, we should not show it in the first place as the requests would be guaranteed to fail which would make for a rather poor experience.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The Permissions class should receive two new capabilities:
    • VIEW_WP_DASHBOARD_WIDGET
    • VIEW_ADMIN_BAR_MENU
  • For now, both capabilities will use the same logic for checking them: * They should be added to the list of base capabilities with similar behavior as VIEW_DASHBOARD. * They should however use the same logic as VIEW_AUTHENTICATED_DASHBOARD, i.e. they should only be available to authenticated users (in addition to the above base capability to core mapping).

Implementation Brief

Test Coverage

  • PHPUnit tests that ensure these capabilities are returned when the appropriate permissions exist/don’t exist should be added.

QA Brief

QA

  • This issue should not affect any existing functionality as it simply ‘adds’ capabilities without ‘using’ them (for now). Thus, it should suffice to smoke test the plugin:
    • with and without the Dashboard Sharing feature flag.
    • using an authenticated admin and a non-authenticated admin (they should be able to do/not do things as before, i.e. authenticated admins should still be able to setup and view the dashboard, etc.).

UPDATED QA

  • Verify that a non-authenticated admin and a non-admin user, who would be able to view the shared dashboard (their role should be shared with at least one module), CANNOT view the Admin Bar widget / menu button and the Site Kit Summary on the WP Dashboard.
  • Verify that authenticated admins who can view the full dashboard are still able to view the Admin Bar and WP Dashboard widgets.

Changelog entry

  • Introduce new permissions for viewing Site Kit on the WordPress Dashboard, and in the Admin Bar.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
felixarntzcommented, Jun 16, 2022

Approval ❌

@wpdarren @jimmymadon @aaemnnosttv This has already been flagged in the dashboard sharing bug bash, but this is not behaving like it should. There may have been a misunderstanding during the implementation, since also the QA Brief is not accurate. This change should have end user facing implications: Users with shared access (not connected with their Google account) should be able to view the shared dashboard, but not the Site Kit WP dashboard widget, and not the Site Kit admin bar menu. Essentially, these two areas should never be visible to anyone with shared access.

Sending this back to Execution for consideration. In case this is trivial to fix, it would be great to do that here. Otherwise, since it’s only affecting the dashboardSharing feature flag, we could also fix it later.

1reaction
felixarntzcommented, May 17, 2022

@aaemnnosttv Updated the ACs based on our conversation earlier. Let me know if that looks good to you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

“Find Your Personal Elements”: An Engaging Approach to ...
“Find Your Personal Elements”: An Engaging Approach to Introducing Chemistry to Secondary School Students. Teresa Rodríguez-Blas*.
Read more >
Present on multiple monitors (and view speaker notes privately)
At the top, under Customize your display, is a diagram of the screens connected to your computer, with each screen numbered. If you...
Read more >
Widgets - System experiences - Human Interface Guidelines
Design a realistic preview to display in the widget gallery. Highlighting your widget's capabilities — and clearly representing the experiences each widget type ......
Read more >
Web Content Accessibility Guidelines (WCAG) 2.1 - W3C
0.5.1 New Features in WCAG 2.1; 0.5.2 Numbering in WCAG 2.1 ... For an introduction to WCAG, see the Web Content Accessibility Guidelines ......
Read more >
12 Critical Elements Every Website Homepage Must Have ...
What You Should Include in Your Website Homepage Design · 12. Success Indicators · 11. Resources · 10. Features · 9. Secondary Calls-to-Action...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found