Fluent Commerce Logo
Docs

Restrict UserAction button visibility by using user roles

How-to Guide

Author:

Fluent Commerce

Changed on:

14 Sept 2023

Key Points

  • The below example demonstrates how the visibility of the CREATE WAVE button in Fluent STORE can be customised via roles, permissions, and the manifest.

Steps

Step arrow right iconCheck the current Wave Screen

Before making any changes, open up the STORE Wave screen and check if the CREATE WAVE button is visible. (Note: Ensure you have at least 1 awaiting_wave fulfilment sitting pending to show the CREATE WAVE button):No alt provided

Step arrow right iconUpdate Manifest

Add the following code snippet inside the userAction button in Manifest: `fc.mystique.manifest.store.fragment.waves`No alt provided

Step arrow right iconCheck the wave screen

Go back to the STORE again and do a browser-level refresh.  The CREATE WAVE button should now be hidden:No alt provided

Step arrow right iconCreate a new user role

Now go to the postman to create a new role:No alt provided


Step arrow right iconAssign Role to the Store user

Assign the new role to the STORE user:No alt providedNo alt provided

Step arrow right iconCheck the Wave Screen

Go back to Fluent STORE and refresh the page. The location user should able to see the CREATE WAVE button on the screen because the user now contains the new role:No alt provided

Step arrow right iconRemoving Roles from a user

You can easily remove the roles from the user by using this GQL mutation:No alt provided

Fluent Commerce

Fluent Commerce