-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement organization creation permission controls #1373
Conversation
🦋 Changeset detectedLatest commit: 8c0cf20 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 |
f861892
to
5274f30
Compare
@@ -80,6 +80,7 @@ export class User extends BaseResource implements UserResource { | |||
publicMetadata: UserPublicMetadata = {}; | |||
unsafeMetadata: UserUnsafeMetadata = {}; | |||
lastSignInAt: Date | null = null; | |||
createOrganizationEnabled = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we actually default this to false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't matter in this case as a User is always initialized from json data.
You definitely have more context than me,but this seems fine!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Great news! Jit hasn't found any security issues in your PR. Good Job! 🏆
5274f30
to
3c2c4e3
Compare
packages/types/src/userSettings.ts
Outdated
@@ -83,14 +83,14 @@ export type Attributes = { | |||
}; | |||
|
|||
export type Actions = { | |||
delete_self: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not, but tests failed because of it, and fixed now!
64fd8e5
to
6a4bc3f
Compare
@@ -101,7 +102,6 @@ export interface UserSettingsJSON extends ClerkResourceJSON { | |||
sign_in: SignInData; | |||
sign_up: SignUpData; | |||
password_settings: PasswordSettingsData; | |||
actions: Actions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a move to make the placement consistent between the resource and json types
9754384
to
28266a4
Compare
…roperties to User
28266a4
to
422c167
Compare
* feat(clerk-js): Hide 'create organization' button in org switcher if no permissions
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. |
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-extension
gatsby-plugin-clerk
build/tooling/chore
Description
If the "user can create organizations" permission is false, the "create organization" button will not appear in the
OrganizationSwitcher
component.