Introduce internal Gate component - #1834
Conversation
🦋 Changeset detectedLatest commit: 3c1a648 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| publicMetadata: OrganizationMembershipPublicMetadata = {}; | ||
| publicUserData!: PublicUserData; | ||
| organization!: Organization; | ||
| // eslint-disable-next-line |
There was a problem hiding this comment.
Note: adding (string & {}) allows for getting eslint autocomplete but also accepts any string
There was a problem hiding this comment.
Should we write this in a comment?
| if (domain) { | ||
| setData({ ...domain }); | ||
| callbacks?.onSuccess?.({ ...domain }); | ||
| if (typeof result !== 'undefined') { |
There was a problem hiding this comment.
Note for reviewer: if value is an object then do a shallow copy otherwise use the actual value
da0696a to
28afb35
Compare
| '@clerk/types': patch | ||
| --- | ||
|
|
||
| Introduces a new method isAuthorized in the Session class. Returns a promise and checks whether the active user is allowed to perform an action based on the passed (required) permission and the ones attached to the membership. |
There was a problem hiding this comment.
| Introduces a new method isAuthorized in the Session class. Returns a promise and checks whether the active user is allowed to perform an action based on the passed (required) permission and the ones attached to the membership. | |
| Introduces a new `isAuthorized()` method in the `Session` class. Returns a promise and checks whether the active user is allowed to perform an action based on the passed (required) permission and the ones attached to the membership. |
| '@clerk/clerk-js': patch | ||
| --- | ||
|
|
||
| Introduces an internal Gate component (supporting hook and HOC) which enables us to conditionally render parts of our components based on a users permissions. |
There was a problem hiding this comment.
| Introduces an internal Gate component (supporting hook and HOC) which enables us to conditionally render parts of our components based on a users permissions. | |
| Introduces an internal `<Gate/>` component (supporting hook and HOC) which enables us to conditionally render parts of our components based on a users permissions. |
chanioxaris
left a comment
There was a problem hiding this comment.
Let's mark any new permission related types and functions as experimental for now
|
This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
This PR
isAuthorizedin theSessionclass. Returns a promise (future proofing) and checks whether the active user is allowed to perform an action based on the passed (required) permission and the ones attached to the membership.isAdminchecks)Checklist
npm testruns as expected.npm run buildruns as expected.Type of change
Packages affected
@clerk/clerk-js@clerk/clerk-react@clerk/nextjs@clerk/remix@clerk/types@clerk/themes@clerk/localizations@clerk/clerk-expo@clerk/backend@clerk/clerk-sdk-node@clerk/shared@clerk/fastify@clerk/chrome-extensiongatsby-plugin-clerkbuild/tooling/chore