-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat(ee): enterprise feature flags, permission group platform controls, audit logs ui, delete account #4115
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
96e3914
feat(ee): enterprise feature flags, permission group platform control…
waleedlatif1 3453932
fix(settings): improve sidebar skeleton fidelity and fix credit purch…
waleedlatif1 755bce6
revert(settings): remove delete account feature
waleedlatif1 a54549e
fix(settings): address pr review — atomic autoAddNewMembers, extract …
waleedlatif1 ed7de17
chore(helm): add CREDENTIAL_SETS_ENABLED to values.yaml
waleedlatif1 c557c07
fix(access-control): dynamic platform category columns, atomic permis…
waleedlatif1 d04e7f4
fix(access-control): restore triggers section in blocks tab
waleedlatif1 78ed32c
fix(access-control): merge triggers into tools section in blocks tab
waleedlatif1 34a238c
upgrade tubro
waleedlatif1 f706006
fix(access-control): fix Select All state when config has stale black…
waleedlatif1 8682c72
fix(access-control): derive platform Select All from features list; r…
waleedlatif1 2774363
fix(access-control): fix blocks Select All check, filter empty platfo…
waleedlatif1 be879f4
revert(settings): restore original skeleton icon and text sizes
waleedlatif1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { NextResponse } from 'next/server' | ||
| import { getSession } from '@/lib/auth' | ||
| import { getBlacklistedProvidersFromEnv } from '@/lib/core/config/feature-flags' | ||
|
|
||
| export async function GET() { | ||
| const session = await getSession() | ||
| if (!session?.user?.id) { | ||
| return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }) | ||
| } | ||
|
|
||
| return NextResponse.json({ | ||
| blacklistedProviders: getBlacklistedProvidersFromEnv(), | ||
| }) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import { db } from '@sim/db' | ||
| import { user, workspace } from '@sim/db/schema' | ||
| import { createLogger } from '@sim/logger' | ||
| import { and, eq, ne, sql } from 'drizzle-orm' | ||
| import { NextResponse } from 'next/server' | ||
| import { getSession } from '@/lib/auth' | ||
| import { generateRequestId } from '@/lib/core/utils/request' | ||
| import { captureServerEvent } from '@/lib/posthog/server' | ||
|
|
||
| const logger = createLogger('DeleteUserAPI') | ||
|
|
||
| export const dynamic = 'force-dynamic' | ||
|
|
||
| export async function DELETE() { | ||
| const requestId = generateRequestId() | ||
|
|
||
| try { | ||
| const session = await getSession() | ||
|
|
||
| if (!session?.user?.id) { | ||
| logger.warn(`[${requestId}] Unauthorized account deletion attempt`) | ||
| return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }) | ||
| } | ||
|
|
||
| const userId = session.user.id | ||
|
|
||
| captureServerEvent(userId, 'user_deleted', {}) | ||
|
|
||
| await db.transaction(async (tx) => { | ||
| await tx | ||
| .update(workspace) | ||
| .set({ billedAccountUserId: sql`owner_id` }) | ||
| .where(and(eq(workspace.billedAccountUserId, userId), ne(workspace.ownerId, userId))) | ||
|
|
||
| await tx.delete(workspace).where(eq(workspace.ownerId, userId)) | ||
|
|
||
| await tx.delete(user).where(eq(user.id, userId)) | ||
| }) | ||
|
|
||
| logger.info(`[${requestId}] User account deleted`, { userId }) | ||
|
|
||
| return NextResponse.json({ success: true }) | ||
| } catch (error) { | ||
| logger.error(`[${requestId}] Account deletion error`, error) | ||
| return NextResponse.json({ error: 'Internal server error' }, { status: 500 }) | ||
| } | ||
| } | ||
|
waleedlatif1 marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.