-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[permissions] Place lab + billing behind settings/workspace permission gates #10354
Conversation
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.
lgtm
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.
PR Summary
Added permission gates to lab and billing functionality, requiring workspace settings permissions for access and modifications.
- Added
PermissionsModule
topackages/twenty-server/src/engine/core-modules/billing/billing.module.ts
andlab.module.ts
for permission control - Added
SettingsPermissionsGuard
withWORKSPACE
feature requirement tobilling.resolver.ts
andlab.resolver.ts
- Added permission check for Lab section in
useSettingsNavigationItems.tsx
, requiring both lab feature flags and workspace permissions - Added comprehensive integration tests in
workspace.integration-spec.ts
andsecurity.integration-spec.ts
to verify permission gates - Protected billing portal and lab feature flag updates with proper role-based access controls
8 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
describe('updateBillingSubscription', () => { | ||
it('should throw a permission error when user does not have permission (member role)', async () => { |
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.
logic: Test name 'updateBillingSubscription' doesn't match the actual test (BillingPortalSession). Either the test name or the test content needs to be updated.
describe('updateBillingSubscription', () => { | |
it('should throw a permission error when user does not have permission (member role)', async () => { | |
describe('billingPortalSession', () => { | |
it('should throw a permission error when user does not have permission (member role)', async () => { |
...ty-server/test/integration/graphql/suites/settings-permissions/workspace.integration-spec.ts
Show resolved
Hide resolved
describe('billingPortalSession', () => { | ||
it('should throw a permission error when user does not have permission (member role)', async () => { |
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.
style: Duplicate test case - billingPortalSession test is identical to updateBillingSubscription test above
mutation DeleteCurrentWorkspace { | ||
deleteCurrentWorkspace { | ||
id | ||
__typename | ||
} | ||
} | ||
`, |
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.
style: GraphQL mutation indentation is inconsistent with rest of file
2e13317
to
95d3f59
Compare
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.
LGTM!
No description provided.