Skip to content

v1.0.3

Choose a tag to compare

@FlorentinLedy FlorentinLedy released this 12 Oct 14:38
· 6 commits to main since this release

v1.0.3 - Multiple Relationship Support for AuthorizedContent 馃殌

Summary

This update enhances the AuthorizedContent component to support multiple relationships, allowing content to be conditionally rendered based on one or more specified user relationships. This feature provides greater flexibility in managing access permissions for complex roles and scenarios.

New Features

Multiple Relationship Support

  • AuthorizedContent now accepts a single relationship (e.g., "Admin") or an array of relationships (e.g., ["Admin", "Member"]).
  • When passing multiple relationships, AuthorizedContent will render content if the user has at least one of the specified relationships.

Enhanced Flexibility

  • Simplifies the management of roles with different permissions across entities, enabling broader use cases.

Code Example

<AuthorizedContent entityId="team1" entityType="Team" relationship={["Member", "Admin"]}>
  <p>Accessible to Team1 Members or Admins</p>
</AuthorizedContent>

Installation

Update to the latest version:

npm install react-rebac@latest

Or with Yarn:

yarn add react-rebac@latest

Thank you for using react-rebac, and please share any feedback or issues!