-
Notifications
You must be signed in to change notification settings - Fork 293
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
Invalid language in "Insufficient permissions" errors for non-authenticated users #6201
Comments
I'm unable to recreate this on other sites, nor can @adamdunnage . Tested on TasteWP and InstaWP setups. Happy to share a login to a site to the site where this does appear. |
Steps to reproduce updated, with recording of experience below: ApqL3qrNy2.mp4 |
@aaemnnosttv IIRC the general direction we took with regard to a module becoming "unshared" after it's been shared for view-only previously was to just remove it from the view-only dashboard (without showing a notice that "admin XYZ has unshared this" or similar). So having this error deviates from this direction. Or is your thinking more that this is not "unsharing", due to e.g. the admin account being deleted or themselves losing access for whatever reason, so won't fall in the set of cases described above? If that is so, then at least we should point people to some way out. E.g. "contact another admin of the site to see if they can restore access" or something along these lines? |
It's easy for some of the language to get a bit mixed as there are some similar but different things happening conceptually so I'll try to clarify. When you say "unshared" – to me that means that the module owner went into the sharing settings and removed a shared role from the module. In that case, the view only users would no longer see anything on their dashboard from that module, so that much has not changed. When a shared module is no longer shareable (i.e. sharing is enabled but interrupted), based on information that we have in WP alone (not considering external API access), then we consider that module to be recoverable. In that case, the module is still shown on the dashboard but with informational (non-error) placeholders. See #5376. This issue is about a separate scenario from those above where sharing is enabled, and the module owner has lost access to the external entity on the Google service. This means the module owner would see the same insufficient permissions error as well. We don't store the concept of whether or not a user's access token has access to a given service/entity as this would further complicate things in a non-trivial way.
Yes – this is an external condition that we won't know for sure until requests are made. As for guiding the user, that's mostly what this issue is about (adjusting the language) so I'm open to any suggestions you have for what you'd prefer to see there. The current language can be seen here https://google.github.io/site-kit-wp/storybook/develop/?path=/story/components-reporterror--report-error-with-insufficient-permissions which does offer some guidance but is specific to "your Google account" which is of course invalid in the context of a view-only user. I've suggested we reword this to be "The sharing administrator's Google account" with the rest of the message the same. Let me know what you think and how we can improve this? |
In that case I think we can adapt the language here to make it clear it's not about "insufficient permissions" (since the users never had these permissions to begin with, and the point of dashboard sharing is that they don't need these permissions to see the dashboard). |
Thanks @marrrmarrr – a few suggestions for your consideration:
This is potentially inaccurate because the administrator who originally shared the module could be different than the admin who is currently sharing (e.g. changing connection or recovering the module). How about: The administrator sharing this module with you ?
Sharing doesn't necessarily need to be done again so we could simplify it to: You can contact them or another administrator to restore access. |
@aaemnnosttv thanks for clarifying, both suggestions SG. So we're left with: |
Great, I'll update the AC with this and move it forward! Thanks @marrrmarrr 👍 |
IB ✔️ |
@sashadoes @nfmohit @techanvil Looking at https://github.com/google/site-kit-wp/pull/6292/files#diff-b95a49b3fe9c5fd7c5b5f782eef76c5c71fd74299f4bdce4a7156144db48d621R90, I'm questioning whether the logic there is right? The ACs state that "The error shown for insufficient permissions" should change. But the logic in the PR puts the check before the check for whether the error even is an insufficient permissions error. To be fair, that part already seems incorrect in the IB. Please take a look. |
Thank you for noticing and for pointing it out, @felixarntz! I've opened #6337 to address this. |
…ns-followup Fix logic for view-only users in "Insufficient permissions" errors
QA Update ❌I've noticed that for authenticated users if user lost access to internet then the error description is correct -
But for non authenticated users (View -only dashboard) error description is same as we are showing in case of insufficient permission error and Retry button is not showing. Also, the title is not bold. Authenticatd user—Signed in Admin Non Authenticated user (View only dashboard) **On Latest- error appears in case of Data error. |
Hi @mohitwp, I have taken a look but am unable to reproduce this. For me, the correct "You are probably offline" error message still appears on the view-only Dashboard. I've tried with both an admin and a non-admin user, here's a screenshot for the admin user: Please can you double-check the steps you are taking to reproduce this? If you are still able to then please document the steps to reproduce in a bit more detail. |
QA Update ✅Thank you, @techanvil. I'm also not able to replicate this error now.
|
Bug Description
When sharing a view only version of a dashboard, Analytics permission errors (and possibly others) are output in the view only dashboard. This includes for administrators (if they selected the view only dashboard) and for non administrator roles.
lz8fRYyLcb.mp4
This is similar to what was reported previously: #5551
Steps to reproduce
Screenshots
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Heading
Body
Implementation Brief
assets/js/components/ReportError.js
:getMessage()
function:useViewOnly()
hook. If so:title
variable as mentioned in the ACs as the heading (translatable).{Module Name}
and{Google Service}
placeholders in the ACs should be replaced with the name of the module (module.name
).return
statement, display thediv.googlesitekit-error-cta-wrapper
element only if the current user is not a view-only user.ReportError
with insufficient permissions but for a view-only user.Test Coverage
assets/js/components/ReportError.test.js
:QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: