Skip to content

RBA

RBA Concept

RBA is built-in feature in harmony that give you the option to store in redux store the permissions list to the store after login.

RBA Actions

RBA is a base feature that not import automatic to harmony project.

  • RBAStatus - enum of the all the possible status of each permission
    • hidden
    • disabled
    • visible
  • policies - async call to the RBA api and store it in rba slice in store. basically you call it once user login.
  • setPermissions - set the rba permissions. basically you call it when user perform logout to clear or set by any other value.

What is the structure of the permissions object after the mapping process?

{
  "rba": {
    "permissions": {
      "shipment": "hidden",
      "searchInput": "disabled",
      "addToCart": "disabled"
    }
  }
}

RBAC Component

To use the RBAC component that will wrap your ui component you need to do the following:

import { RBAC } from '@common-components';

In your render you will need to use it as following:

<RBAC id="searchInput">
    <Form.Control
        type="text"
        data-automation-id="filter-input"
        placeholder="Search"
        onChange={(e) => this.setState({ searchValue: e.target.value.toLowerCase() })}
    />
</RBAC>