Repository navigation
v1.0.3
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
AuthorizedContentnow accepts a single relationship (e.g., "Admin") or an array of relationships (e.g., ["Admin", "Member"]).- When passing multiple relationships,
AuthorizedContentwill 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@latestOr with Yarn:
yarn add react-rebac@latestThank you for using react-rebac, and please share any feedback or issues!