google / google/site-kit-wp

Improve experience of actions that require additional scopes

Open
#3,623 5 comments 0 reactions 2 assignees Assigned to @aaemnnosttv View on GitHub
Module: Analytics Module: Tag Manager P2 Type: Enhancement UX
Dominant language
JavaScript
Stars
1.4k
Forks
384
Avg merge
4d 14h
Merged PRs (30d)
77

Description

## Feature Description

Certain API requests in Site Kit require additional scopes than those required for the minimum needed for module setup and function which are generally read-only. E.g. creating a new Analytics property.

When the request is made, Site Kit will return a special error if the user has not granted sufficient permissions to perform the action and is prompted with an action-specific modal before they confirm to be sent through the oAuth scope request/grant flow and back before they can retry.

In most cases, we have sufficient information to know that this will happen before it does because Site Kit is aware of the scopes that have been granted since the last page load. With this information, we should be able to set expectations ahead of time about the need to grant additional permissions or even bypass the need for the permissions modal entirely with preemptive messaging. We already do this for Analytics account provisioning as shown below:
![image](https://user-images.githubusercontent.com/1621608/123122085-61e70600-d44e-11eb-84fc-c2a3cba9de61.png)

In this circumstance, we do not show the permission scope modal and instead send the user directly to oAuth.

In either case, we should reevaluate this flow to better inform the user (similar to above) as to when we already know that additional permissions are necessary rather than "surprising" them with it at the time of taking action.

---------------

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

## Acceptance criteria

* All user journeys that involve taking actions that require elevated permissions to create an entity on the service remotely should be updated where necessary to _proactively_ inform the user that they will need to grant additional permissions for Site Kit to be able to act on their behalf. This feedback should be conditional based on SK's awareness of the user's currently granted scopes.
* Visual treatments and associated language should be updated according to revised designs: [TBD](#)

## Implementation Brief

*

### Test Coverage

*

### Visual Regression Changes

*

## QA Brief

*

## Changelog entry

*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.