ovh/manager

[manager-components]: fix useOvhIam hook

Closed this issue · 0 comments

On which entity, you would like to report a bug?

useOvhIam

Description

Currently the hook considers we are authorized to do an action only if the action list length on the component (ManagerButton, ManagerText) has the same length as the list of authorized actions for the given urn

The problem is that we could have more authorized actions for a given urn than needed for a specific action. We should instead verify if all the needed actions are contained in the list of authorized actions for the given urn.

Steps to reproduce

Use a component ManagerButton with a list of actions smaller than the list of authorized actions for the given urn : the button will stay disabled although we have the authorized actions in the list.

Browser

No response

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response