-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(invitations): added FF to disable invitations, added to permission groups, added workspace members admin endpoints #2783
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
Conversation
…on groups, added workspace members admin endpoints
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryOverviewThis PR adds comprehensive invitation control features through three mechanisms:
Key ChangesBackend
Frontend
Documentation & Deployment
Implementation QualityStrengths
ArchitectureThe implementation follows established patterns in the codebase:
Testing ConsiderationsWhile the PR mentions "Tested manually", automated tests would be valuable for:
Security Analysis
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Frontend
participant API
participant PermissionCheck
participant FeatureFlags
participant PermissionGroup
participant DB
Note over User,DB: Invitation Disabled via Feature Flag
User->>Frontend: Attempt to send invitation
Frontend->>Frontend: Check usePermissionConfig()
Frontend->>FeatureFlags: getEnv('NEXT_PUBLIC_DISABLE_INVITATIONS')
FeatureFlags-->>Frontend: isInvitationsDisabled=true
Frontend->>User: Hide invitation UI elements
Note over User,DB: Invitation Disabled via Permission Group
User->>Frontend: Attempt to send invitation (UI visible)
Frontend->>API: POST /api/organizations/[id]/invitations
API->>PermissionCheck: validateInvitationsAllowed(userId)
PermissionCheck->>FeatureFlags: Check isInvitationsDisabled
FeatureFlags-->>PermissionCheck: false (FF not set)
PermissionCheck->>DB: getUserPermissionConfig(userId)
DB->>PermissionGroup: Get user's permission group
PermissionGroup-->>DB: config.disableInvitations=true
DB-->>PermissionCheck: Permission config
PermissionCheck-->>API: Throw InvitationsNotAllowedError
API-->>Frontend: 403 Forbidden
Frontend-->>User: Error: Invitations not allowed
Note over User,DB: Admin API Workaround
User->>Frontend: Use Admin API (invitations disabled)
Frontend->>API: POST /api/v1/admin/workspaces/[id]/members
API->>API: Authenticate with x-admin-key
API->>DB: Insert workspace permission
DB-->>API: Success
API-->>Frontend: Member added
Frontend-->>User: Success
|
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.
No files reviewed, no comments
Summary
Type of Change
Testing
Tested manually
Checklist