Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Description

Allow admins to remove members from workspace. Previously, when someone was added they couldn't be removed. Also, allows them to revoke a pending invitation.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Tested manually to ensure it actually kicks the removed member out of the workspace

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

@vercel
Copy link

vercel bot commented Jul 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2025 5:35am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jul 16, 2025 5:35am

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR adds critical workspace management functionality by implementing the ability for workspace admins to remove members and revoke pending invitations. Previously, once members were added to a workspace, there was no way to remove them - a significant limitation for workspace administration.

Key changes include:

  1. New DELETE endpoints for handling member removal and invitation revocation
  2. Enhanced permission checks to ensure only admins can perform these operations
  3. Updated WorkspaceUser interface to include membershipId for member management
  4. Comprehensive test coverage across all new functionality
  5. UI updates in the workspace selector component to support member removal

The implementation is thorough with proper security considerations, including:

  • Preventing removal of the last workspace owner
  • Validating invitation status before deletion
  • Checking admin permissions before allowing member removal
  • Adding proper error handling and user feedback

The code quality is high with extensive test coverage and careful consideration of edge cases.

Confidence score: 4.5/5

  1. This PR is safe to merge as it adds needed functionality with proper safeguards
  2. High confidence due to comprehensive test coverage and careful permission handling
  3. Files needing attention:
    • apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-selector/components/invite-modal/invite-modal.tsx (complex UI logic)
    • apps/sim/app/api/workspaces/members/[id]/route.ts (critical member removal endpoint)

8 files reviewed, no comments
Edit PR Review Bot Settings | Greptile

@waleedlatif1 waleedlatif1 force-pushed the fix/remove-invitation branch from e6853cd to 05e5455 Compare July 16, 2025 01:30
@delve-auditor
Copy link

delve-auditor bot commented Jul 16, 2025

No security or compliance issues detected. Reviewed everything up to b266785.

Security Overview
  • 🔎 Scanned files: 20 changed file(s)
Detected Code Changes

The diff is too large to display a summary of code changes.

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@vercel vercel bot temporarily deployed to Preview – docs July 16, 2025 01:30 Inactive
@vercel vercel bot temporarily deployed to Preview – docs July 16, 2025 05:31 Inactive
@waleedlatif1 waleedlatif1 merged commit bdfe7e9 into staging Jul 16, 2025
6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/remove-invitation branch July 16, 2025 05:35
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
…udioai#701)

* fix(invitation): added ability for admins to remove members of their workspace

* lint

* remove references to workspace_member db table

* remove deprecated @next/font

* only allow admin to rename workspace

* bring workflow name change inline, remove dialog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants