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

Show a banner when user is logged in with limited access #1259

Merged
merged 2 commits into from
Feb 14, 2020

Conversation

lyyder
Copy link
Contributor

@lyyder lyyder commented Feb 14, 2020

Show a banner when a user is logged in with limited access. In practice this means that an operator is logged in on behalf of a marketplace user. In such case the access token received from Auth API has scope user:limited

The banner is tied to the Topbar component. It is hidden on SearchPage as there it would push the top bar on top of the search panel.

Desktop:

Screenshot 2020-02-14 at 11 45 43

Mobile:

Screenshot 2020-02-14 at 11 45 55

Add `authScopes` attribute to the Auth store. It stores an array of
scopes associated with the currently stored token.
@lyyder lyyder requested review from OtterleyW and Gnito and removed request for OtterleyW February 14, 2020 09:53
Comment on lines 321 to 322
"LimitedAccessBanner.message": "Your are logged in as {firstName} {lastName}. You have limited rights for actions.",
"LimitedAccessBanner.logout": "Log out",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add the English texts to other translation files. In case some key is missing from the translation file we will default to the English version in the code. (Same with es.json and dr.json)

Copy link
Contributor

@Gnito Gnito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. (The banner is not shown on CheckoutPage since Topbar is not used there atm.)

Show a banner if a user is logged in with an access token that has
`user:limited` scope.
@lyyder lyyder merged commit 606cec3 into master Feb 14, 2020
@lyyder lyyder deleted the login-as-user-banner branch February 14, 2020 12:42
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